CVRF Wiki
cvrfwiki
https://cvrf.miraheze.org/wiki/Main_Page
MediaWiki 1.40.1
first-letter
Media
Special
Talk
User
User talk
CVRF Wiki
CVRF Wiki talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Module
Module talk
Template:Namespace
10
40
95
2010-07-28T08:35:08Z
mw>Rocket000
0
allow for changing the page it evaluates
wikitext
text/x-wiki
{{#switch:{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}}}
| {{ns:0}}=gallery
| {{ns:2}}=user page
| {{ns:4}}=project page
| {{ns:6}}=media file
| {{ns:8}}=system message
| {{ns:10}}=template
| {{ns:14}}=category
| {{TALKSPACE}}=talk page
| page}}<noinclude>
{{documentation}}
[[Category:Function templates|{{PAGENAME}}]]
</noinclude>
87365f1ed043eac399b5779a98e7dfa958df56a3
Template:TSwitch
10
44
103
2011-07-03T11:55:09Z
mw>Rd232
0
[[Category:Internationalization templates]]
wikitext
text/x-wiki
{{{1}}}/{{#ifexist:Template:{{{1}}}/{{int:lang}}|{{int:lang}}|{{CONTENTLANG}}}}<noinclude>
{{documentation}}
[[Category:Internationalization templates]]
</noinclude>
873e12d3ffbcd17e722d71b4a538192b7ede5dbc
Template:Clickable button/iconclass
10
33
81
2013-09-14T10:25:00Z
mw>Rillke
0
evaluating text arg
wikitext
text/x-wiki
{{#if:{{{3|}}}
|<!-- a text was specified
-->{{#if:{{{1|}}}
|<!-- a primary icon was specified -->{{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-text-icons
|<!-- no secondary icon was specified --> ui-button-text-icon-primary
}}
|<!-- no primary icon specified --> {{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-text-icon-secondary
|<!-- no secondary icon was specified --> ui-button-text-only
}}
}}
|<!-- no text was specified
-->{{#if:{{{1|}}}
|<!-- a primary icon was specified -->{{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-icons-only
|<!-- no secondary icon was specified --> ui-button-icon-only
}}
|<!-- no primary icon specified --> {{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-icon-only
|<!-- no secondary icon was specified --> error
}}
}}
}}
b7e75e0febaea1235889d2f960296c3d7149777a
Module:URLutil
828
88
191
2013-09-27T10:56:52Z
mw>Rillke
0
Rillke moved page [[Module:Modul:URLutil]] to [[Module:URLutil]] without leaving a redirect: rm import gibberish
Scribunto
text/plain
--[=[ URLutil 2013-08-09
Utilities for URL etc. on www.
* getURIScheme()
* getAuthority()
* getHost()
* getPort()
* getScheme()
* getTLD()
* getTop2domain()
* getTop3domain()
* isAuthority()
* isDomain()
* isDomainExample()
* isHost()
* isIP()
* isIPlocal()
* isIPv4()
* isIPv6()
* isMailAddress()
* isMailLink()
* isProtocolMW()
* isProtocolDialog()
* isProtocolWiki()
* isResourceURL()
* isSuspiciousURL()
* isUnescapedURL()
* isWebURL()
* wikiEscapeURL()
Only [[dotted decimal]] notation for IPv4 supported.
Does not support dotted hexadecimal, dotted octal, or single-number formats.
IPv6 URL (bracketed) not yet implemented; might need Wikintax escaping anyway.
]=]
-- table for export
local URLutil = {}
URLutil.getURIScheme = function ( uri )
if type( uri ) == "string" then
local prot, colon, slashes = uri:match( "^%s*([a-zA-Z]*)(:?)(/?/?)" )
if #colon == 1 and #prot >= 2 then
return prot:lower()
elseif #slashes == 2 and #prot == 0 then
return "//"
end
end
return false
end -- getURIScheme()
local getTopDomain = function ( url, mode )
local host = URLutil.getHost( url )
if host then
local pattern = "[%w%%]+%.[a-z][a-z]+)$"
if mode == 3 then
pattern = "[%w%%]+%." .. pattern
end
host = mw.ustring.match( "." .. host, "%.(" .. pattern )
if host then
return host
end
end
return false
end -- getTopDomain()
URLutil.getAuthority = function ( url )
if type( url ) == "string" then
local host, colon, port = mw.ustring.match( url .. "/", "^%s*%w*:?//([%w%.%%-]+)(:?)([%d]*)/" )
if URLutil.isHost( host ) then
host = mw.ustring.lower( host )
if colon == ":" then
if port:find( "^[1-9]" ) then
return ( host .. ":" .. port )
end
elseif #port == 0 then
return host
end
end
end
return false
end -- URLutil.getAuthority()
URLutil.getHost = function ( url )
local auth = URLutil.getAuthority( url )
if auth then
return mw.ustring.match( auth, "^([%w%.%%-]+):?[%d]*$" )
end
return false
end -- URLutil.getHost()
URLutil.getPort = function ( url )
url = URLutil.getAuthority( url )
if url then
url = url:match( ":([1-9][0-9]*)$" )
if type( url ) == "string" then
return tonumber( url )
end
end
return false
end -- URLutil.getPort()
URLutil.getScheme = function ( url )
if type( url ) == "string" then
local prot, colon, slashes = url:match( "^%s*([a-zA-Z]*)(:?)(//)" )
if slashes == "//" then
if colon == ":" then
if #prot > 2 then
return prot:lower() .. "://"
end
elseif #prot == 0 then
return "//"
end
end
end
return false
end -- URLutil.getScheme()
URLutil.getTLD = function ( url )
local host = URLutil.getHost( url )
if host then
host = mw.ustring.match( host, "[%w]+%.([a-z][a-z]+)$" )
return host or false
end
return false
end -- URLutil.getTLD()
URLutil.getTop2domain = function ( url )
return getTopDomain( url, 2 )
end -- URLutil.getTop2domain()
URLutil.getTop3domain = function ( url )
return getTopDomain( url, 3 )
end -- URLutil.getTop3domain()
URLutil.isAuthority = function ( s )
if type( s ) == "string" then
local host, colon, port = mw.ustring.match( s, "^%s*([%w%.%%-]+)(:?)(%d*)%s*$" )
if colon == ":" then
port = port:match( "^[1-9][0-9]*$" )
if type( port ) ~= "string" then
return false
end
elseif port ~= "" then
return false
end
return URLutil.isHost( host )
end
return false
end -- URLutil.isAuthority()
URLutil.isDomain = function ( s )
if type( s ) == "string" then
s = mw.ustring.match( s, "^%s*([%w%.%%-]+%w)%.[a-zA-Z][a-zA-Z]+%s*$" )
if type( s ) == "string" then
if mw.ustring.find( s, "^%w" ) then
if mw.ustring.find( s, "..", 1, true ) then
return false
else
return true
end
end
end
end
return false
end -- URLutil.isDomain()
URLutil.isDomainExample = function ( url )
-- RFC 2606: example.com example.net example.org example.edu
local r = getTopDomain( url, 2 )
if r then
local s = r:lower():match( "^example%.([a-z][a-z][a-z])$" )
if s then
r = ( s == "com" or
s == "edu" or
s == "net" or
s == "org" )
else
r = false
end
end
return r
end -- URLutil.isDomainExample()
URLutil.isHost = function ( s )
return URLutil.isDomain( s ) or URLutil.isIP( s )
end -- URLutil.isHost()
URLutil.isIP = function ( s )
return URLutil.isIPv4( s ) and 4 or URLutil.isIPv6( s ) and 6
end -- URLutil.isIP()
URLutil.isIPlocal = function ( s )
-- IPv4 according to RFC 1918, RFC 1122; even any 0.0.0.0 (RFC 5735)
local r = false
local num = s:match( "^ *([01][0-9]*)%." )
if num then
num = tonumber( num )
if num == 0 then
r = s:match( "^ *0+%.[0-9]+%.[0-9]+%.[0-9]+ *$" )
elseif num == 10 or num == 127 then
-- loopback; private/local host: 127.0.0.1
r = URLutil.isIPv4( s )
elseif num == 169 then
-- 169.254.*.*
elseif num == 172 then
-- 172.(16...31).*.*
num = s:match( "^ *0*172%.([0-9]+)%." )
if num then
num = tonumber( num )
if num >= 16 and num <= 31 then
r = URLutil.isIPv4( s )
end
end
elseif beg == 192 then
-- 192.168.*.*
num = s:match( "^ *0*192%.([0-9]+)%." )
if num then
num = tonumber( num )
if num == 168 then
r = URLutil.isIPv4( s )
end
end
end
end
if r then
r = true
end
return r
end -- URLutil.isIPlocal()
URLutil.isIPv4 = function ( s )
local function legal( n )
return ( tonumber( n ) < 256 )
end
if type( s ) == "string" then
local p1, p2, p3, p4 = s:match( "^%s*([1-9][0-9]?[0-9]?)%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%s*$" )
if p1 and p2 and p3 and p4 then
return legal( p1 ) and legal( p2 ) and legal( p3 ) and legal( p4 )
end
end
return false
end -- URLutil.isIPv4()
URLutil.isIPv6 = function ( s )
local dcolon, groups
if type( s ) ~= "string"
or s:len() == 0
or s:find( "[^:%x]" ) -- only colon and hex digits are legal chars
or s:find( "^:[^:]" ) -- can begin or end with :: but not with single :
or s:find( "[^:]:$" )
or s:find( ":::" )
then
return false
end
s = mw.text.trim( s )
s, dcolon = s:gsub( "::", ":" )
if dcolon > 1 then
return false
end -- at most one ::
s = s:gsub( "^:?", ":" ) -- prepend : if needed, upper
s, groups = s:gsub( ":%x%x?%x?%x?", "" ) -- remove valid groups, and count them
return ( ( dcolon == 1 and groups < 8 ) or
( dcolon == 0 and groups == 8 ) )
and ( s:len() == 0 or ( dcolon == 1 and s == ":" ) ) -- might be one dangling : if original ended with ::
end -- URLutil.isIPv6()
URLutil.isMailAddress = function ( s )
if type( s ) == "string" then
s = mw.ustring.match( s, "^%s*[%w%.%%_-]+@([%w%.%%-]+)%s*$" )
return URLutil.isDomain( s )
end
return false
end -- URLutil.isMailAddress()
URLutil.isMailLink = function ( s )
if type( s ) == "string" then
local addr
s, addr = mw.ustring.match( s, "^%s*([Mm][Aa][Ii][Ll][Tt][Oo]):(%S[%w%.%%_-]*@[%w%.%%-]+)%s*$" )
if type( s ) == "string" then
if s:lower() == "mailto" then
return URLutil.isMailAddress( addr )
end
end
end
return false
end -- URLutil.isMailLink()
local function isProtocolAccepted( prot, supplied )
if type( prot ) == "string" then
local scheme, colon, slashes = mw.ustring.match( prot, "^%s*([a-zA-Z]*)(:?)(/?/?)%s*$" )
if slashes ~= "/" then
if scheme == "" then
if colon ~= ":" and slashes == "//" then
return true
end
elseif colon == ":" or slashes == "" then
local s = supplied:match( " " .. scheme:lower() .. " " )
if type( s ) == "string" then
return true
end
end
end
end
return false
end -- isProtocolAccepted()
URLutil.isProtocolMW = function ( prot )
return isProtocolAccepted( prot,
" http https ftp ftps ssh sftp irc ircs xmpp sip sips gopher telnet nntp worldwind mailto tel sms news svn git mms bitcoin magnet urn geo " )
end -- URLutil.isProtocolMW()
URLutil.isProtocolDialog = function ( prot )
return isProtocolAccepted( prot, " mailto irc ircs ssh telnet " )
end -- URLutil.isProtocolDialog()
URLutil.isProtocolWiki = function ( prot )
return isProtocolAccepted( prot,
" ftp ftps git http https nntp sftp svn worldwind " )
end -- URLutil.isProtocolWiki()
URLutil.isResourceURL = function ( url )
local scheme = URLutil.getScheme( url )
if scheme then
local s = " // http:// https:// ftp:// "
s = s:find( " " .. scheme .. " " )
if s then
if URLutil.getAuthority( url ) then
if not url:match( "%S%s+%S" ) then
return true
end
end
end
end
return false
end -- URLutil.isResourceURL()
URLutil.isSuspiciousURL = function ( url )
if URLutil.isResourceURL( url ) then
local s = URLutil.getAuthority( url )
local pat = "[%[|%]" ..
mw.ustring.char( 8201, 45, 8207, 8234, 45, 8239, 8288 )
.. "]"
if s:find( "@" )
or url:find( "''" )
or url:find( pat )
or url:find( "[%.,]$" ) then
return true
end
-- TODO zero width character ??
return false
end
return true
end -- URLutil.isSuspiciousURL()
URLutil.isUnescapedURL = function ( url, trailing )
if type( trailing ) ~= "string" then
if URLutil.isWebURL( url ) then
if url:match( "[%[|%]]" ) then
return true
end
end
end
return false
end -- URLutil.isUnescapedURL()
URLutil.isWebURL = function ( url )
if URLutil.getScheme( url ) and URLutil.getAuthority( url ) then
if not url:match( "%S%s+%S" ) then
return true
end
end
return false
end -- URLutil.isWebURL()
URLutil.wikiEscapeURL = function ( url )
if url:find( "[%[|%]]" ) then
local n
url, n = url:gsub( "%[", "[" )
:gsub( "|", "|" )
:gsub( "%]", "]" )
end
return url
end -- URLutil.wikiEscapeURL()
-- Provide template access and expose URLutil table to require
local p = {}
function p.getURIScheme( frame )
return URLutil.getURIScheme( frame.args[ 1 ] ) or ""
end
function p.getAuthority( frame )
return URLutil.getAuthority( frame.args[ 1 ] ) or ""
end
function p.getHost( frame )
return URLutil.getHost( frame.args[ 1 ] ) or ""
end
function p.getPort( frame )
return URLutil.getPort( frame.args[ 1 ] ) or ""
end
function p.getScheme( frame )
return URLutil.getScheme( frame.args[ 1 ] ) or ""
end
function p.getTLD( frame )
return URLutil.getTLD( frame.args[ 1 ] ) or ""
end
function p.getTop2domain( frame )
return URLutil.getTop2domain( frame.args[ 1 ] ) or ""
end
function p.getTop3domain( frame )
return URLutil.getTop3domain( frame.args[ 1 ] ) or ""
end
function p.isAuthority( frame )
return URLutil.isAuthority( frame.args[ 1 ] ) and "1" or ""
end
function p.isDomain( frame )
return URLutil.isDomain( frame.args[ 1 ] ) and "1" or ""
end
function p.isDomainExample( frame )
return URLutil.isDomainExample( frame.args[ 1 ] ) and "1" or ""
end
function p.isHost( frame )
return URLutil.isHost( frame.args[ 1 ] ) and "1" or ""
end
function p.isIP( frame )
return URLutil.isIP( frame.args[ 1 ] ) or ""
end
function p.isIPlocal( frame )
return URLutil.isIPlocal( frame.args[ 1 ] ) and "1" or ""
end
function p.isIPv4( frame )
return URLutil.isIPv4( frame.args[ 1 ] ) and "1" or ""
end
function p.isIPv6( frame )
return URLutil.isIPv6( frame.args[ 1 ] ) and "1" or ""
end
function p.isMailAddress( frame )
return URLutil.isMailAddress( frame.args[ 1 ] ) and "1" or ""
end
function p.isMailLink( frame )
return URLutil.isMailLink( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolMW( frame )
return URLutil.isProtocolMW( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolDialog( frame )
return URLutil.isProtocolDialog( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolWiki( frame )
return URLutil.isProtocolWiki( frame.args[ 1 ] ) and "1" or ""
end
function p.isResourceURL( frame )
return URLutil.isResourceURL( frame.args[ 1 ] ) and "1" or ""
end
function p.isSuspiciousURL( frame )
return URLutil.isSuspiciousURL( frame.args[ 1 ] ) and "1" or ""
end
function p.isUnescapedURL( frame )
return URLutil.isUnescapedURL( frame.args[ 1 ], frame.args[ 2 ] ) and "1" or ""
end
function p.isWebURL( frame )
return URLutil.isWebURL( frame.args[ 1 ] ) and "1" or ""
end
function p.wikiEscapeURL( frame )
return URLutil.wikiEscapeURL( frame.args[ 1 ] )
end
function p.URLutil()
return URLutil
end
return p
dee7f13cff878a48fa5ee79e162a4ca2e1454c8d
Module:FileUtil
828
84
183
2013-09-27T11:09:25Z
mw>Rillke
0
Rillke moved page [[Module:Module:FileUtil]] to [[Module:FileUtil]] without leaving a redirect: -duplicate NS
Scribunto
text/plain
--[=[ MediaUtil
Utilities for handling of media files, e.g. images, videos, ...
* addParameter()
* replaceParameter()
]=]
-- table for export
local FileUtil = {}
FileUtil.addParameter = function ( file, parameter, value ) -- "value" is optional (default: "nil")
return FileUtil.replaceParameter( file, parameter, value , false)
end -- FileUtil.addParameter()
FileUtil.replaceParameter = function ( file, parameter, value , replace) -- "value" is optional (default: "nil")
-- "replace" is optional (default: "true")
local replace = (replace == Nil or replace == true)
if type( file ) == "string" then
local fileNew,n = FileUtil.removeParameter(file, parameter)
if n==0 or replace then
if value then
fileNew = fileNew:gsub('(%]%])','|'..parameter..'='..value..']]')
else
fileNew = fileNew:gsub('(%]%])','|'..parameter..']]')
end
return fileNew
else
return file
end
end
return false
end -- FileUtil.replaceParameter()
FileUtil.removeParameter = function ( file, parameter )
if type( file ) == "string" then
local fileNew,n = file:gsub('|%s*'..parameter..'%s*[^|%]]*%s*([|%]])','%1')
return fileNew,n
end
return false
end -- FileUtil.removeParameter()
-- Provide template access and expose URLutil table to require
local p = {}
function p.addParameter( frame )
return FileUtil.addParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"],
frame.args[3] or frame.args["value"]) or ""
end
function p.replaceParameter( frame )
return FileUtil.replaceParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"],
frame.args[3] or frame.args["value"]) or ""
end
function p.removeParameter( frame )
return FileUtil.removeParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"]) or ""
end
function p.FileUtil()
return FileUtil
end
return p
21b8ce921a622a9a34b889f6b9ce6c97b673ec86
Template:Clickable button 2/Icons
10
72
159
2014-10-29T11:40:54Z
mw>Romaine
0
wikitext
text/x-wiki
<!-- Liste von http://api.jqueryui.com/theming/icons/ -->
<ul style="list-style-type:none;list-style-image:none;">
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-n"> </span>
<span>carat-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-ne"> </span>
<span>carat-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-e"> </span>
<span>carat-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-se"> </span>
<span>carat-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-s"> </span>
<span>carat-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-sw"> </span>
<span>carat-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-w"> </span>
<span>carat-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-nw"> </span>
<span>carat-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-2-n-s"> </span>
<span>carat-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-2-e-w"> </span>
<span>carat-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-n"> </span>
<span>triangle-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-ne"> </span>
<span>triangle-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-e"> </span>
<span>triangle-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-se"> </span>
<span>triangle-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-s"> </span>
<span>triangle-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-sw"> </span>
<span>triangle-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-w"> </span>
<span>triangle-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-nw"> </span>
<span>triangle-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-2-n-s"> </span>
<span>triangle-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-2-e-w"> </span>
<span>triangle-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-n"> </span>
<span>arrow-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-ne"> </span>
<span>arrow-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-e"> </span>
<span>arrow-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-se"> </span>
<span>arrow-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-s"> </span>
<span>arrow-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-sw"> </span>
<span>arrow-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-w"> </span>
<span>arrow-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-nw"> </span>
<span>arrow-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-n-s"> </span>
<span>arrow-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-ne-sw"> </span>
<span>arrow-2-ne-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-e-w"> </span>
<span>arrow-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-se-nw"> </span>
<span>arrow-2-se-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-n"> </span>
<span>arrowstop-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-e"> </span>
<span>arrowstop-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-s"> </span>
<span>arrowstop-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-w"> </span>
<span>arrowstop-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-n"> </span>
<span>arrowthick-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-ne"> </span>
<span>arrowthick-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-e"> </span>
<span>arrowthick-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-se"> </span>
<span>arrowthick-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-s"> </span>
<span>arrowthick-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-sw"> </span>
<span>arrowthick-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-w"> </span>
<span>arrowthick-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-nw"> </span>
<span>arrowthick-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-n-s"> </span>
<span>arrowthick-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-ne-sw"> </span>
<span>arrowthick-2-ne-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-e-w"> </span>
<span>arrowthick-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-se-nw"> </span>
<span>arrowthick-2-se-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-n"> </span>
<span>arrowthickstop-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-e"> </span>
<span>arrowthickstop-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-s"> </span>
<span>arrowthickstop-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-w"> </span>
<span>arrowthickstop-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-w"> </span>
<span>arrowreturnthick-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-n"> </span>
<span>arrowreturnthick-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-e"> </span>
<span>arrowreturnthick-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-s"> </span>
<span>arrowreturnthick-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-w"> </span>
<span>arrowreturn-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-n"> </span>
<span>arrowreturn-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-e"> </span>
<span>arrowreturn-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-s"> </span>
<span>arrowreturn-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-w"> </span>
<span>arrowrefresh-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-n"> </span>
<span>arrowrefresh-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-e"> </span>
<span>arrowrefresh-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-s"> </span>
<span>arrowrefresh-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-4"> </span>
<span>arrow-4</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-4-diag"> </span>
<span>arrow-4-diag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-extlink"> </span>
<span>extlink</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-newwin"> </span>
<span>newwin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-refresh"> </span>
<span>refresh</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-shuffle"> </span>
<span>shuffle</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-transfer-e-w"> </span>
<span>transfer-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-transferthick-e-w"> </span>
<span>transferthick-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-folder-collapsed"> </span>
<span>folder-collapsed</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-folder-open"> </span>
<span>folder-open</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-document"> </span>
<span>document</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-document-b"> </span>
<span>document-b</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-note"> </span>
<span>note</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-mail-closed"> </span>
<span>mail-closed</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-mail-open"> </span>
<span>mail-open</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-suitcase"> </span>
<span>suitcase</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-comment"> </span>
<span>comment</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-person"> </span>
<span>person</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-print"> </span>
<span>print</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-trash"> </span>
<span>trash</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-locked"> </span>
<span>locked</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-unlocked"> </span>
<span>unlocked</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-bookmark"> </span>
<span>bookmark</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-tag"> </span>
<span>tag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-home"> </span>
<span>home</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-flag"> </span>
<span>flag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-calculator"> </span>
<span>calculator</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-cart"> </span>
<span>cart</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pencil"> </span>
<span>pencil</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-clock"> </span>
<span>clock</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-disk"> </span>
<span>disk</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-calendar"> </span>
<span>calendar</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-zoomin"> </span>
<span>zoomin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-zoomout"> </span>
<span>zoomout</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-search"> </span>
<span>search</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-wrench"> </span>
<span>wrench</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-gear"> </span>
<span>gear</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-heart"> </span>
<span>heart</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-star"> </span>
<span>star</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-link"> </span>
<span>link</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-cancel"> </span>
<span>cancel</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-plus"> </span>
<span>plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-plusthick"> </span>
<span>plusthick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-minus"> </span>
<span>minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-minusthick"> </span>
<span>minusthick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-close"> </span>
<span>close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-closethick"> </span>
<span>closethick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-key"> </span>
<span>key</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-lightbulb"> </span>
<span>lightbulb</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-scissors"> </span>
<span>scissors</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-clipboard"> </span>
<span>clipboard</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-copy"> </span>
<span>copy</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-contact"> </span>
<span>contact</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-image"> </span>
<span>image</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-video"> </span>
<span>video</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-script"> </span>
<span>script</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-alert"> </span>
<span>alert</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-info"> </span>
<span>info</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-notice"> </span>
<span>notice</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-help"> </span>
<span>help</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-check"> </span>
<span>check</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-bullet"> </span>
<span>bullet</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-radio-off"> </span>
<span>radio-off</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-radio-on"> </span>
<span>radio-on</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pin-w"> </span>
<span>pin-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pin-s"> </span>
<span>pin-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-play"> </span>
<span>play</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pause"> </span>
<span>pause</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-next"> </span>
<span>seek-next</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-prev"> </span>
<span>seek-prev</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-end"> </span>
<span>seek-end</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-first"> </span>
<span>seek-first</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-stop"> </span>
<span>stop</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-eject"> </span>
<span>eject</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-volume-off"> </span>
<span>volume-off</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-volume-on"> </span>
<span>volume-on</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-power"> </span>
<span>power</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-signal-diag"> </span>
<span>signal-diag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-signal"> </span>
<span>signal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-0"> </span>
<span>battery-0</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-1"> </span>
<span>battery-1</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-2"> </span>
<span>battery-2</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-3"> </span>
<span>battery-3</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-plus"> </span>
<span>circle-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-minus"> </span>
<span>circle-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-close"> </span>
<span>circle-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-e"> </span>
<span>circle-triangle-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-s"> </span>
<span>circle-triangle-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-w"> </span>
<span>circle-triangle-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-n"> </span>
<span>circle-triangle-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-e"> </span>
<span>circle-arrow-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-s"> </span>
<span>circle-arrow-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-w"> </span>
<span>circle-arrow-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-n"> </span>
<span>circle-arrow-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-zoomin"> </span>
<span>circle-zoomin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-zoomout"> </span>
<span>circle-zoomout</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-check"> </span>
<span>circle-check</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-plus"> </span>
<span>circlesmall-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-minus"> </span>
<span>circlesmall-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-close"> </span>
<span>circlesmall-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-plus"> </span>
<span>squaresmall-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-minus"> </span>
<span>squaresmall-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-close"> </span>
<span>squaresmall-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-dotted-vertical"> </span>
<span>grip-dotted-vertical</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-dotted-horizontal"> </span>
<span>grip-dotted-horizontal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-solid-vertical"> </span>
<span>grip-solid-vertical</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-solid-horizontal"> </span>
<span>grip-solid-horizontal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-gripsmall-diagonal-se"> </span>
<span>gripsmall-diagonal-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-diagonal-se"> </span>
<span>grip-diagonal-se</span>
</li>
</ul><noinclude></noinclude>
4b72ae93de1029b8b0f8decc15c742a130981cdc
Template:Div col end
10
122
283
2015-10-03T15:58:07Z
en>NeilN
0
Changed protection level of Template:Div col end: per request at [[WP:RFPP]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
<includeonly></div></includeonly><noinclude>
{{Documentation|Template:Div col/doc}}
</noinclude>
78088d41c21d779e3722f220fcc9773dfbbc1e4f
Template:Clear
10
118
275
2015-10-04T23:53:36Z
en>Nyttend
0
Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
430
275
2018-06-24T11:44:39Z
templatewiki>Sau226
0
1 revision imported: Mass importing office templates & modules
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Trim
10
60
135
2015-10-28T17:38:01Z
mw>Steinsplitter
0
Protected Template:Trim: used in widely used templates ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{#if:1|{{{1|}}}}}<noinclude>
{{documentation}}
[[Category:String manipulation templates]]
</noinclude>
5496baa4e911ad0126f59e72161d97f5d555bb5b
Template:I18n/or
10
77
169
2017-05-03T06:45:53Z
mw>Sarang
0
+lang
wikitext
text/x-wiki
{{langSwitch|lang={{{lang|}}}
|ar=أو
|bn=অথবা
|ca=o
|cs=nebo
|da=eller
|de=oder
|el=ή
|en=or
|eo=aŭ
|es=o<!-- /u -->
|et=või
|fa=یا
|fi=tai
|fr=ou
|gl=ou
|he=או
|hu=vagy
|it=o
|ja=または
|mk=или
|ml=അഥവാ
|nds=oder
|nl=of
|nn=eller
|no=eller
|os=ó
|pl=lub
|pt=ou
|pt-br=ou
|ro=sau
|ru=или
|sl=ali
|sv=eller
|tg=ё
|th=หรือ
|tr=ve
|uk=або
|zh=或
}}<noinclude>
{{documentation|i18n/doc}}
[[Category:Internationalization templates using LangSwitch|{{PAGENAME}}]]
[[Category:Commons templates-or|{{PAGENAME}}]]
</noinclude>
c33f32a97ebff25129031e26b5713a4022b5cb35
Template:Parameter names example
10
129
303
2017-10-09T17:20:51Z
en>MusikAnimal
0
Protected "[[Template:Parameter names example]]": [[WP:High-risk templates|Highly visible template]]; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
450
303
2018-06-24T11:44:35Z
templatewiki>Sau226
0
1 revision imported: Mass importing office templates & modules
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
Template:Clickable button 2
10
29
73
2017-11-05T01:43:45Z
mw>Speravir
0
English alias
wikitext
text/x-wiki
<onlyinclude><span class="plainlinks">[<!--
-->{{#if:{{#invoke:URLutil|isProtocolMW|{{#invoke:URLutil|getURIScheme|1={{{link|{{{1|}}}}}}}}}}
|{{{link|{{{1}}}}}}
|{{#ifeq:{{padleft:|1|{{{link|{{{1|}}}}}}}}|#
|{{fullurl:{{FULLPAGENAME}}{{{link|{{{1}}}}}}}}
|{{fullurl:{{{link|{{{1|#}}}}}}}}
}}
}} <!--
--><span class="ui-button ui-widget ui-state-default ui-corner-all {{#switch:{{{color|{{{Farbe|}}}}}}
|red |red2 |red3 |rot |rot2 |rot3 = ui-button-red
|green|green2|green3|grün|grün2|grün3 = ui-button-green
|blue|blue2|blue3|blau|blau2|blau3 = ui-button-blue
}}" style="vertical-align:middle; {{#switch:{{{color|{{{Farbe|}}}}}}
|rot2 |red2 = background:linear-gradient(to bottom, #e98888 0%, #c97272 90%) !important;
|grün2|green2 = background:linear-gradient(to bottom, #7ddeb3 0%, #72be93 90%) !important;
|blau2|blue2 = background:linear-gradient(to bottom, #88b3f4 0%, #7d9dd4 90%) !important;
|rot3 |red3 = background:linear-gradient(to bottom, #f5e2e2 0%, #963131 90%) !important;
|grün3|green3 = background:linear-gradient(to bottom, #ddffcc 0%, #669955 90%) !important;
|blau3|blue3 = background:linear-gradient(to bottom, #ebecf8 0%, #4c55c3 90%) !important;
}}" role="button" title="{{{title|{{{Titel|{{FULLPAGENAME:{{{link|{{{1|Main page}}}}}}}}}}}}}}"><!--
--><span style="display:table;padding:{{{padding|0.25em 0.5em}}};"><!--
-->{{#if:{{{icon|}}}|<span class="ui-icon ui-icon-{{{icon}}}" style="display:table-cell;vertical-align:middle;"> </span>}}<!--
-->{{#if:{{{image|{{{Bild|}}}}}}|<span style="display:table-cell;vertical-align:middle;">{{#invoke:FileUtil|replaceParameter|1={{{image|{{{Bild|}}}}}}|2=link|3=}}</span>}}<!--
--><span style="display:table-cell;vertical-align:middle;line-height:1.4;{{#if:{{{icon|}}}{{{image|{{{Bild|}}}}}}|text-align:left;padding-left:0.25em;}}">{{{text|{{{2|Button}}}}}}</span><!--
--></span></span>]</span></onlyinclude>
{{documentation}}
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
3a0bedd327ba497aabd5a1b53cca82626c092a56
Template:Clickable button
10
28
71
2017-12-25T12:09:09Z
mw>Zhuyifei1999
0
- extra linebreak
wikitext
text/x-wiki
<onlyinclude>{{#if:{{{3|{{{external|}}}}}}
| <span class="plainlinks" {{#if:{{{id|}}}|id="{{{id}}}"}}>[{{{1|{{{target|//parameter_target_is_empty.de}}}}}} <span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
|{{{4|{{{iconPrimary|}}}}}}
|{{{5|{{{iconSecondary|}}}}}}
|{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
}} {{{class|}}}" role="button" aria-disabled="false"><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
|<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}"> </span>
}}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
|<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}"> </span>
}}</span>]</span><!--
-->
| [[{{{1|{{{target|Parameter target is empty!}}}}}}|<span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
|{{{4|{{{iconPrimary|}}}}}}
|{{{5|{{{iconSecondary|}}}}}}
|{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
}} {{{class|}}}" role="button" aria-disabled="false" {{#if:{{{id|}}}|id="{{{id}}}"}}><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
|<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}"> </span>
}}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
|<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}"> </span>
}}</span>]]
}}<!--
--></onlyinclude>
{{documentation}}
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
1e2bf69f76d6d53c1e6f86d2aba7da15ea0518d0
Module:Sidebar
828
170
500
2018-02-01T14:28:54Z
templatewiki>MacFan4000
0
1 revision imported: Basic templates
Scribunto
text/plain
--
-- This module implements {{Sidebar}}
--
require('Module:No globals')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local navbar = require('Module:Navbar')._navbar
local function trimAndAddAutomaticNewline(s)
-- For compatibility with the original {{sidebar with collapsible lists}}
-- implementation, which passed some parameters through {{#if}} to trim
-- their whitespace. This also triggered the automatic newline behavior.
-- ([[meta:Help:Newlines and spaces#Automatic newline]])
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
local function hasSubgroup(s)
if mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
else
return false
end
end
function p.sidebar(frame, args)
if not args then
args = getArgs(frame)
end
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == 'yes'
root = root:tag('table')
if not child then
root
:addClass('vertical-navbox')
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
:addClass(args.bodyclass or args.class)
:css('float', args.float or 'right')
:css('clear', (args.float == 'none' and 'both') or args.float or 'right')
:css('width', args.width or '22.0em')
:css('margin', args.float == 'left' and '0 1.0em 1.0em 0' or '0 0 1.0em 1.0em')
:css('background', '#f9f9f9')
:css('border', '1px solid #aaa')
:css('padding', '0.2em')
:css('border-spacing', '0.4em 0')
:css('text-align', 'center')
:css('line-height', '1.4em')
:css('font-size', '88%')
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(args.outertitleclass)
:css('padding-bottom', '0.2em')
:css('font-size', '125%')
:css('line-height', '1.2em')
:css('font-weight', 'bold')
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(args.topimageclass)
:css('padding', '0.4em 0')
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:css('padding-top', '0.2em')
:css('line-height', '1.2em')
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:css('padding-top', args.topimage and '0.2em' or '0.4em')
:css('line-height', '1.2em')
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass('vertical-navbox-subgroup')
:css('width', '100%')
:css('margin', '0px')
:css('border-spacing', '0px')
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.titleclass)
:cssText(args.basestyle)
:css('padding', '0.2em 0.4em 0.2em')
:css('padding-top', args.pretitle and 0)
:css('font-size', '145%')
:css('line-height', '1.2em')
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(args.imageclass)
:css('padding', '0.2em 0 0.4em')
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:css('padding-top', '0.2em')
:css('line-height', '1.2em')
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(args.aboveclass)
:css('padding', '0.3em 0.4em 0.3em')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3 and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(args.headingclass)
:css('padding', '0.1em')
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
root
:tag('tr')
:tag('td')
:addClass(args.contentclass)
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
:newline() -- Without a linebreak after the </td>, a nested list like "* {{hlist| ...}}" doesn't parse correctly.
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(args.belowclass)
:css('padding', '0.3em 0.4em 0.3em')
:css('font-weight', 'bold')
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child then
local navbarArg = args.navbar or args.tnavbar
if navbarArg ~= 'none' and navbarArg ~= 'off' and (args.name or frame:getParent():getTitle():gsub('/sandbox$', '') ~= 'Template:Sidebar') then
root
:tag('tr')
:tag('td')
:css('text-align', 'right')
:css('font-size', '115%')
:cssText(args.navbarstyle or args.tnavbarstyle)
:wikitext(navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle or args.tnavbarfontstyle
})
end
end
return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
end
function p.collapsible(frame)
local args = getArgs(frame)
args.abovestyle = 'border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;' .. (args.abovestyle or '')
args.belowstyle = 'border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;' .. (args.belowstyle or '')
args.navbarstyle = 'padding-top: 0.6em;' .. (args.navbarstyle or args.tnavbarstyle or '')
if not args.name and frame:getParent():getTitle():gsub('/sandbox$', '') == 'Template:Sidebar with collapsible lists' then
args.navbar = 'none'
end
local contentArgs = {}
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and (args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass('NavFrame')
:addClass((not expand) and 'collapsed' or nil)
:css('border', 'none')
:css('padding', 0)
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:tag('div')
:addClass('NavHead')
:addClass(args.listtitleclass)
:css('font-size', '105%')
:css('background', 'transparent')
:css('text-align', 'left')
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num .. 'title'] or 'List'))
:done()
:tag('div')
:addClass('NavContent')
:addClass(args.listclass)
:addClass(args['list' .. num .. 'class'])
:css('font-size', '105%')
:css('padding', '0.2em 0 0.4em')
:css('text-align', 'center')
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args)
end
return p
c9e636a93bc3b868bb53b389630e9e30e73f9c66
Template:Yesno-no
10
141
329
2018-02-13T20:27:17Z
en>WOSlinker
0
separate pp-template not needed
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Help:Infobox/user style
12
142
458
2018-02-14T16:58:26Z
templatewiki>Rob Kam
0
clean up
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<source lang="css">.infobox { display: none; }</source>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<source lang="js">$('.infobox').hide();</source>
Be aware that although, per [[WP:Manual of Style/Infoboxes]], all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tl|Taxobox}}, and the OMIM and other medical database codes of {{tl|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g, for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
{{En-WP attribution notice|Help:Infobox/user style}}
</noinclude>
4fda0d930222287834320c97764e5f28be9c153b
Template:Nobold
10
126
444
2018-02-14T17:28:38Z
templatewiki>Rob Kam
0
clean up
wikitext
text/x-wiki
<span style="font-weight:normal;">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
{{En-WP attribution notice|Template:Nobold}}
</noinclude>
5f47d4907dc0c4ed2ca599a675ee67d9b1f7f264
297
2018-10-23T17:15:13Z
en>Frietjes
0
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Sidebar
10
131
452
2018-02-14T17:37:09Z
templatewiki>Rob Kam
0
clean up
wikitext
text/x-wiki
<includeonly>{{#invoke:Sidebar|sidebar}}</includeonly><noinclude>{{En-WP attribution notice|Template:Sidebar}}</noinclude>
8a4b9dc32de4bd612932baa67ee01c9c14e87301
Module:Namespace detect
828
193
484
2018-02-15T17:57:34Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Module:Pagetype
828
196
494
2018-02-15T17:57:35Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
if redirect then
return redirect
else
return getNsDetectValue(args)
end
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
4e76ed8318e724693304c0ca2063b36b0890825a
Module:Pagetype/config
828
197
496
2018-02-15T17:57:35Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['book'] = 'book',
['draft'] = 'draft',
['education program'] = 'education program page',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module',
'book'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'book',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
cbb04dd488cb9335e0f9f749e3d106e6071cfead
Template:En-WP attribution notice
10
191
438
2018-02-23T09:37:47Z
templatewiki>Rob Kam
0
wikitext
text/x-wiki
<includeonly>{| style="border: 1px solid #e0e0e0; background-color: #f8f8f8; color:black; margin: 5px auto; width: 60%;"
|-
| style="padding: 3px 10px;" | [[File:Wikipedia-logo-v2.svg|30px|Wikipedia logo]]
| style="font-size: 90%; padding: 3px;" | This {{Pagetype}} uses material from the Wikipedia {{Pagetype|page={{{1|{{FULLPAGENAME}}}}}}} [[w:en:{{{1|{{FULLPAGENAME}}}}}|{{{1|{{FULLPAGENAME}}}}}]], which is released under the [[w:en:Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License|Creative Commons Attribution-ShareAlike 3.0 Unported License]] ([https://en.wikipedia.org/w/index.php?title={{urlencode:{{{1|{{FULLPAGENAME}}}}}}}&action=history view authors]).
|}
[[Category:{{Pagetype|category=Categorie}}s from English Wikipedia]]</includeonly>
<noinclude>
{{documentation}}
[[Category:Attribution templates]]
{{En-WP attribution notice|Template:En-WP attribution notice}}
</noinclude>
2f8572b5c25751c527d33ac2122cfc3cdcc7d622
Template:Pagetype
10
192
446
2018-02-23T12:07:52Z
templatewiki>Rob Kam
0
add attribution (via JWB)
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Pagetype}}
</noinclude>
b6d5e4de8a716664120e2fd68dd5932b85777262
Template:Distinguish
10
119
277
2018-03-03T23:40:51Z
en>Plastikspork
0
[[Wikipedia:Templates for discussion/Log/2018 February 19#Template:Distinguish2]] closed as merge ([[WP:XFDC|XFDcloser]])
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
432
277
2018-09-22T13:39:30Z
templatewiki>Rob Kam
0
add attribution (via JWB)
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
{{En-WP attribution notice|Template:Distinguish }}
</noinclude>
caf112c527ca2e1dd3988f241b2c2da896e77283
Module:Distinguish
828
144
337
2018-04-01T10:06:10Z
en>Galobtter
0
fixed with text and selfref
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
462
337
2018-09-20T19:04:46Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Template:LangSwitch
10
79
173
2018-06-04T12:13:39Z
mw>Jarekt
0
Switch to [[Module:LangSwitch]]; allow multiple languages to map to a single value
wikitext
text/x-wiki
<includeonly>{{#invoke:LangSwitch|langSwitch}}</includeonly><noinclude>
{{heavily used template}}
{{Documentation}}
</noinclude>
43a599bd276c3f0b29a41e77cfe705b2f085fb6d
Module:Parameter names example
828
167
498
2018-06-24T11:44:33Z
templatewiki>Sau226
0
1 revision imported: Mass importing office templates & modules
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
391f002bab27f87b76adcc1e33439496d080e6ab
Module:Hatnote
828
152
470
2018-06-24T11:46:01Z
templatewiki>Sau226
0
1 revision imported: Mass importing office templates & modules
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.formatPages(...)
-- Formats a list of pages using formatLink and returns it as an array. Nil
-- values are not allowed.
local pages = {...}
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink(page)
end
return ret
end
function p.formatPageTables(...)
-- Takes a list of page/display tables and returns it as a list of
-- formatted links. Nil values are not allowed.
local pages = {...}
local links = {}
for i, t in ipairs(pages) do
checkType('formatPageTables', i, t, 'table')
local link = t[1]
local display = t[2]
links[i] = p._formatLink(link, display)
end
return links
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage and yesno(addTrackingCategory) ~= false then
category = 'Hatnote templates with errors'
category = string.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return string.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return string.format('%s (%s)', page, disambiguator)
end
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format hatnote link}} template.
--------------------------------------------------------------------------------
function p.formatLink(frame)
local args = getArgs(frame)
local link = args[1]
local display = args[2]
if not link then
return p.makeWikitextError(
'no link specified',
'Template:Format hatnote link#Errors',
args.category
)
end
return p._formatLink(link, display)
end
function p._formatLink(link, display)
checkType('_formatLink', 1, link, 'string')
checkType('_formatLink', 2, display, 'string', true)
-- Remove the initial colon for links where it was specified manually.
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
if not display then
local prePipe, postPipe = link:match('^(.-)|(.*)$')
link = prePipe or link
display = postPipe
end
-- Find the display value.
if not display then
local page, section = link:match('^(.-)#(.*)$')
if page then
display = page .. ' § ' .. section
end
end
-- Assemble the link.
if display then
return string.format(
'[[:%s|%s]]',
string.gsub(link, '|(.*)$', ''), --display overwrites manual piping
display
)
else
return string.format('[[:%s]]', link)
end
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
local options = {}
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
options.extraclasses = args.extraclasses
options.selfref = args.selfref
return p._hatnote(s, options)
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local classes = {'hatnote', 'navigation-not-searchable'}
local extraclasses = options.extraclasses
local selfref = options.selfref
if type(extraclasses) == 'string' then
classes[#classes + 1] = extraclasses
end
if selfref then
classes[#classes + 1] = 'selfref'
end
return string.format(
'<div role="note" class="%s">%s</div>',
table.concat(classes, ' '),
s
)
end
return p
68269290db95dca1fb485b69372e2b5a90ed79ad
Template:Infobox
10
116
271
2018-08-15T18:33:36Z
en>Primefac
0
Undid revision 855063393 by [[Special:Contributions/Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) rather problematic change mentioned [[Template_talk:Infobox#Using_template_styles_to_reduce_technical_debt_inside_mobile_skin|on talk page]], reverting until it can be sorted
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
428
271
2018-09-22T12:27:25Z
templatewiki>Rob Kam
0
add attribution (via JWB)
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
b181da29e3e571777dffc29307761f8560ea76e5
Module:Hatnote list
828
154
472
2018-09-20T19:04:53Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
-- Stringifies a list generically; probably shouldn't be used directly
function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then list = mHatnote.formatPages(unpack(list)) end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
--searches display text only
function searchDisp(t, f)
return string.find(string.sub(t, (string.find(t, '|') or 0) + 1), f)
end
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return conjList("and", ...) end
function p.orList (...) return conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr = p.andList(v.pages, true) or mHatnote._formatLink(mHatnote.disambiguate(options.title))
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
1550e576b518a6a3a72eea6142608a84c010ebe8
Template:Autotranslate
10
30
75
2018-11-06T21:18:45Z
mw>Jarekt
0
Switch to [[Module:Autotranslate]] with only one function also add "default" option mirroring {{LangSwitch}}
wikitext
text/x-wiki
<includeonly>{{#invoke:Autotranslate|autotranslate}}<!--
-->{{#ifeq: {{FULLPAGENAME}} |Template:{{{base|}}} |[[Category:Autotranslated templates|{{PAGENAME}}]]}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ab72c137619109cd8dab90f289c49eadb1a79b53
Module:Autotranslate
828
61
137
2018-11-07T19:35:28Z
mw>Jarekt
0
bad instructions in comment
Scribunto
text/plain
--[[
__ __ _ _ _ _ _ _ _
| \/ | ___ __| |_ _| | ___ _ / \ _ _| |_ ___ | |_ _ __ __ _ _ __ ___| | __ _| |_ ___
| |\/| |/ _ \ / _` | | | | |/ _ (_) / _ \| | | | __/ _ \| __| '__/ _` | '_ \/ __| |/ _` | __/ _ \
| | | | (_) | (_| | |_| | | __/_ / ___ \ |_| | || (_) | |_| | | (_| | | | \__ \ | (_| | || __/
|_| |_|\___/ \__,_|\__,_|_|\___(_)_/ \_\__,_|\__\___/ \__|_| \__,_|_| |_|___/_|\__,_|\__\___|
Authors and maintainers:
* User:Zolo - original version
* User:Jarekt
]]
-- local function to help normalize input arguments
local function normalize_input_args(input_args, output_args)
for name, value in pairs( input_args ) do
if value ~= '' then -- nuke empty strings
if type(name)=='string' then name=string.lower(name) end -- convert to lower case
output_args[name] = value
end
end
return output_args
end
-- initialize object to be returned
local p = {}
--[[
autotranslate
This function is the core part of the Autotranslate template.
Usage from a template:
{{#invoke:autotranslate|autotranslate|base=|lang= }}
Parameters:
frame.args.base - base page name
frame.args.lang - desired language (often user's native language)
Error Handling:
]]
function p.autotranslate(frame)
-- switch to lowercase parameters to make them case independent
local args = {}
args = normalize_input_args(frame:getParent().args, args)
args = normalize_input_args(frame.args, args)
-- get language fallback list
if not args.lang or not mw.language.isSupportedLanguage(args.lang) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
local langList = mw.language.getFallbacksFor(args.lang)
table.insert(langList,1,args.lang)
-- find base page
local base = args.base
args.base = nil
assert(base and #base>0, 'Base page not provided for autotranslate' )
if not mw.ustring.find(base,':') then -- if base page does not indicate namespace
base = 'Template:' .. base -- than assume it is a template
end
-- find base template language subpage
local page = args.default -- default page if provided or nil otherwise
for _, language in ipairs(langList) do
if mw.title.new(base .. '/' .. language).exists then
page = base .. '/' .. language -- returns only the page
break
end
end
assert(page, string.format('No fallback page found for autotranslate (base=[[%s]], lang=%s)', base, args.lang))
-- Transclude {{page |....}} with template arguments the same as the ones passed to {{autotranslate}} template.
return frame:expandTemplate{ title = page, args = args}
end
return p
f1c4395dd1b0078b2e2f6d40b4320812c3567998
Template:Template other
10
136
317
2018-12-16T22:06:25Z
en>Amorymeltzer
0
Changed protection level for "[[Template:Template other]]": [[WP:High-risk templates|Highly visible template]]: Transclusion count has increased dramatically ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Module:LangSwitch
828
87
189
2019-02-26T04:25:22Z
mw>Jarekt
0
fix error with global variables
Scribunto
text/plain
--[[
__ __ _ _ _ ____ _ _ _
| \/ | ___ __| |_ _| | ___ _| | __ _ _ __ __ _/ ___|_ _(_) |_ ___| |__
| |\/| |/ _ \ / _` | | | | |/ _ (_) | / _` | '_ \ / _` \___ \ \ /\ / / | __/ __| '_ \
| | | | (_) | (_| | |_| | | __/_| |__| (_| | | | | (_| |___) \ V V /| | || (__| | | |
|_| |_|\___/ \__,_|\__,_|_|\___(_)_____\__,_|_| |_|\__, |____/ \_/\_/ |_|\__\___|_| |_|
|___/
Authors and maintainers:
* User:Zolo - original version in Module:Fallback
* User:Jarekt
]]
-- add optional module
-- used for debugging purposes as it detects cases of unintended global variables
require('Module:No globals')
local p = {}
--[[
_langSwitch
This function is the core part of the LangSwitch template.
Example usage from Lua:
text = _langSwitch({en='text in english', pl='tekst po polsku'}, lang)
Parameters:
args - table with translations by language
lang - desired language (often user's native language)
Error Handling:
]]
function p._langSwitch(args, lang) -- args: table of translations
-- Return error if there is not default and no english version
if not args.en and not args.default then
local err = '<b class="error">LangSwitch Error: no default</b>'
if args.nocat == '1' then
return err
else
return err .. '[[Category:LangSwitch template without default version]]'
end
end
-- To improve performance try quick switch, and load fallback chain only if needed.
-- In the vast majority of cases fast switch is sufficient
local val = args[lang]
if val == '~' then
return ''
elseif val and val ~= '' then
return val
elseif args.quick then
return nil
end
-- get the list of accepetable language (lang + those in lang's fallback chain) and check their content
assert(lang, 'LangSwitch Error: no lang')
local langList = mw.language.getFallbacksFor(lang)
table.insert(langList,1,lang)
table.insert(langList,math.max(#langList,2),'default')
for _, language in ipairs(langList) do
val = args[language]
if val == '~' then
return ''
elseif val and val ~= '' then
return val
end
end
end
--[[
langSwitch
This function is the core part of the LangSwitch template.
Example Usage from a template:
{{#invoke:fallback|langSwitch|en=text in english|pl=tekst po polsku|lang={{int:lang}} }}
Parameters:
frame.args - table with translations by language
frame.args.lang - desired language (often user's native language)
Error Handling:
]]
function p.langSwitch(frame) -- version to be used from wikitext
local args = frame.args
-- if no expected args provided than check parent template/module args
if args.en==nil and args.default==nil and args.nocat==nil then
args = mw.getCurrentFrame():getParent().args
end
local lang = args.lang
if not lang or not mw.language.isKnownLanguageTag(lang) then
lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
-- Try quick switch which checks the most likely option when fallback is not needed
args.quick = true;
local val = p._langSwitch(args, lang)
if val then
return val
end
-- Allow input in format: {{LangSwitch|de=Grün|es/it/pt=Verde|fr=Vert|en=Green |lang=en}}
-- with multiple languages mapping to a single value
local args1 = {}
for name, value in pairs( args ) do
if value ~= '' and type(name)=='string' then
for str in string.gmatch( name, "([^/]+)" ) do
args1[str] = value
end
end
end
return p._langSwitch(args1, lang)
end
return p
8c558e084bad5823fd7dc21c4cbc2ce5a6c0e95d
Template:Nobold/styles.css
10
127
299
2019-03-03T23:43:41Z
en>Pppery
0
Adding protection template
sanitized-css
text/css
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Template:Lua
10
125
293
2019-03-20T22:04:45Z
en>RMCD bot
0
Removing notice of move discussion
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:And
10
71
157
2019-05-31T10:48:32Z
mw>Verdy p
0
Verdy p moved page [[Template:And]] to [[Template:Conj-and]]: non ambiguous
wikitext
text/x-wiki
#REDIRECT [[Template:Conj-and]]
66eac08dac0f7de405aa2dc7bfe01a50c7c3c332
Template:Tl
10
54
123
2019-06-06T23:58:20Z
mw>4nn1l2
0
Fulfilling [[Template:Edit request|edit request]] by [[User:Sarang|Sarang]].
wikitext
text/x-wiki
<noinclude>{{protected template}}
</noinclude>{{T/main|{{{1|}}}
|{{{2|}}}
|{{{3|{{{lang|}}}}}}
|{{{4|}}}
|{{{5|}}}
|incl={{{incl|{{{i|3}}}}}}
|code={{{code|}}}
|link={{{link|}}}
|case={{{case|}}}
|i18n={{{i18n|}}}
|parm={{{parm|}}}
|full={{{full|}}}
|style={{{style|}}}
}}<noinclude>
{{documentation|Template:T/doc}}
</noinclude>
06c675ce6e24c57cb8f52ad7ad989aeda3525f57
Template:T/main
10
43
101
2019-06-07T00:06:58Z
mw>4nn1l2
0
Undo revision 353422696 by [[Special:Contributions/4nn1l2|4nn1l2]] ([[User talk:4nn1l2|talk]]) per [[Template:Protected template/doc]]
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{code}}}}}|tt|<code>}}<!-- code start
-->{{#switch:{{#switch:{{{link}}}|no|n|-=1|0}}{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}{{#switch:-|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}<!--
-->|000|010|011|100=|{{#switch:{{{case}}}|i|n={{i18n/namespace|t|link={{{case}}}o|lang={{{i18n|}}}}}|l=template|Template}}:}}<!--
-->{{#switch:{{{link}}}|no|n={{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace;{{{style|}}}">}}<!-- link=no
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6={{}}<!--
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- when "link=no": just display
-->{{#if:{{{parm|}}}||{{{parm}}}}}<!-- optional parm display
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6=}}}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!--
-->|{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- when +: not outside
-->[[:{{#switch:{{{3|}}}|+|-|=|{{trim|{{{3}}}}}:}}<!-- language code (ISO 639-1) (and/or sisterproject prefix)
-->Template:{{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|<!-- =link=
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{case}}}|i|n={{i18n/namespace|t|link=no|lang={{{i18n|}}}}}|l=template|Template}}:}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace,monospace;{{{style|}}}">}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6={{|1|5={}}<!--
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- inside
-->{{#if:{{{code|}}}|<code>}}{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=<tt>}}<!-- code/typewrite start
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- display name
-->{{#if:{{{parm|}}}|{{#switch:||{{padleft:|1|{{{parm}}}}}|{{padleft:|6|{{{parm}}}}}=||}}{{{parm}}}}}<!-- opt. parm
-->{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=</tt>}}{{#if:{{{code|}}}|</code>}}<!-- typewrite/code end
-->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6=}}|1|5=}}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!--
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}<!-- inside
-->]]{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}}}<!-- not outside
-->{{#ifeq:{{lc:{{{code}}}}}|tt|</code>}}<!-- code end
-->{{#if:{{{full|{{#ifeq:{{{5}}}|full|1}}}}}|<span class="plainlinks"><!--
--> <tt>(</tt><small>[{{fullurl:Template:{{{1|{{PAGENAME}}}}}}} {{int:view}}]<!--
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=edit}} {{int:edit}}]<!--
--> • [[:Template talk:{{{1|{{PAGENAME}}}}}|{{int:talk}}]]<!--
--> • [{{fullurl:Special:Whatlinkshere/Template:{{{1|{{PAGENAME}}}}}|limit=500}} Links]<!-- {{int:links}} needs fix
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=history}} History]</small><tt>)</tt><!--
--></span>}}<!--
--><noinclude>
{{documentation|Template:T/doc}}
</noinclude>
e60371a4d777e70155110efe1ec652cd23c183f6
Module:Infobox
828
156
474
2019-07-13T13:05:36Z
imported>Gonnym
0
Undid revision 906073835 by [[Special:Contributions/Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) errors in code were reported
Scribunto
text/plain
--
-- This module implements {{Infobox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local args = {}
local origArgs
local root
local function notempty( s ) return s and s:match( '%S' ) end
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
local function union(t1, t2)
-- Returns the union of the values of two tables, as a sequence.
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
local function getArgNums(prefix)
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function addRow(rowArgs)
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:attr('id', rowArgs.rowid)
:tag('th')
:attr('colspan', 2)
:attr('id', rowArgs.headerid)
:addClass(rowArgs.class)
:addClass(args.headerclass)
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
row:attr('id', rowArgs.rowid)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
if not rowArgs.label then
dataCell
:attr('colspan', 2)
:css('text-align', 'center')
end
dataCell
:attr('id', rowArgs.dataid)
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
local function renderTitle()
if not args.title then return end
root
:tag('caption')
:addClass(args.titleclass)
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
:tag('th')
:attr('colspan', 2)
:addClass(args.aboveclass)
:css('text-align', 'center')
:css('font-size', '125%')
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass(args.belowclass)
:css('text-align', 'center')
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addRow({
data = args['subheader' .. tostring(num)],
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:cssText(args.captionstyle)
:wikitext(caption)
end
addRow({
data = tostring(data),
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
local function renderRows()
-- Gets the union of the header and data argument numbers,
-- and renders them all in order using addRow.
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
headerid = args['headerid' .. tostring(num)],
rowid = args['rowid' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:css('text-align', 'right')
:wikitext(navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
local function renderTrackingCategories()
if args.decat ~= 'yes' then
if args.child == 'yes' then
if args.title then
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
end
end
local function _infobox()
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass((args.subbox ~= 'yes') and 'infobox' or nil)
:addClass(args.bodyclass)
if args.subbox == 'yes' then
root
:css('padding', '0')
:css('border', 'none')
:css('margin', '-3px')
:css('width', 'auto')
:css('min-width', '100%')
:css('font-size', '100%')
:css('clear', 'none')
:css('float', 'none')
:css('background-color', 'transparent')
else
root
:css('width', '22em')
end
root
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
renderSubheaders()
renderImages()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderTrackingCategories()
return tostring(root)
end
local function preprocessSingleArg(argName)
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
local function preprocessArgs(prefixTable, step)
-- Assign the parameters with the given prefixes to the args table, in order, in batches
-- of the step size specified. This is to prevent references etc. from appearing in the
-- wrong order. The prefixTable should be an array containing tables, each of which has
-- two possible fields, a "prefix" string and a "depend" table. The function always parses
-- parameters containing the "prefix" string, but only parses parameters in the "depend"
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present and not blank, or
-- we are processing "prefix1" and "prefix" is present and not blank, and
-- if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
function p.infobox(frame)
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places. Parameters that depend on
-- another parameter are only processed if that parameter is present, to avoid
-- phantom references appearing in article reference lists.
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
{prefix = 'labelid'},
{prefix = 'headerid'},
{prefix = 'rowid'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
preprocessSingleArg('decat')
return _infobox()
end
return p
86cf80d64495ad16eb12aa533ca749c55689b02d
Template:Collapse bottom
10
74
163
2019-07-16T02:06:27Z
mw>4nn1l2
0
Changed protection level for "[[Template:Collapse bottom]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
|}</div><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
fc7cbf7dfc70960dab3fcea6c526a682573c43b6
Template:Collapse top
10
75
165
2019-07-16T02:06:37Z
mw>4nn1l2
0
Changed protection level for "[[Template:Collapse top]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible {{{{{|safesubst:}}}#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|EEF|CFC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{{{{|safesubst:}}}#if:{{{left|}}}|left|center}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <span style="font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|Extended content}}} }}} }}} }}} }}}</span>
{{{{{|safesubst:}}}#if:{{{warning|{{{2|}}}}}}
|{{{{{|safesubst:}}}!}}-
{{{{{|safesubst:}}}!}} style="text-align:center; font-style:italic;" {{{{{|safesubst:}}}!}} {{{2|The following is a closed debate. '''Please do not modify it.''' }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{{{{|safesubst:}}}!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
{{Collapse top/TemplateData}}
</noinclude>
729c380800dedf28ab73e7bc55c50fc198027881
Template:Main other
10
81
177
2019-07-16T03:54:13Z
mw>4nn1l2
0
Changed protection level for "[[Template:Main other]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c8e5526da7586aff37928206e183ceef44ed7829
Template:TemplateDataInfo/toggler
10
53
121
2019-07-16T10:35:52Z
mw>4nn1l2
0
Changed protection level for "[[Template:TemplateDataInfo/toggler]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Move=Allow only template editors and administrators] (indefinite) [Edit=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
<onlyinclude><div class="mw-collapsible mw-collapsed">
<div class="mw-collapsible-toggle" style="cursor:pointer" title="Information about TemplateData">{{Clickable button|iconPrimary=ui-icon-help|target={{FULLPAGENAME}}}}</div>
<div class="mw-collapsible-content">{{autotranslate|base=TemplateDataInfo/i18n}}</div>
</div></onlyinclude>
{{documentation}}
82b6f7e94fa413fec53c88bbc4cec13e66da4664
Template:Transclude
10
59
133
2019-07-16T10:41:02Z
mw>4nn1l2
0
Changed protection level for "[[Template:Transclude]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Move=Allow only template editors and administrators] (indefinite) [Edit=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
{{#switch: {{NAMESPACE: {{{1}}} }}
|#default = {{FULLPAGENAME: {{{1}}} }} <!-- eg "User:Foo" -->
|{{ns:0}} =
{{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }}
| Template:{{{1}}} <!-- no leading colon, eg "Foo" -->
| {{PAGENAME: {{{1}}} }} <!-- leading colon, eg ":Foo", so we want the article -->
}}
}}<noinclude>
{{documentation}}
</noinclude>
d0239e71e5745cd0d4efd032cee07341e111376b
Module:JSON
828
86
187
2019-07-16T11:19:14Z
mw>4nn1l2
0
Changed protection level for "[[Module:JSON]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Move=Allow only template editors and administrators] (indefinite) [Edit=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
-- -*- coding: utf-8 -*-
--
-- Copyright 2010-2012 Jeffrey Friedl
-- http://regex.info/blog/
--
local VERSION = 20111207.5 -- version history at end of file
local OBJDEF = { VERSION = VERSION }
--
-- Simple JSON encoding and decoding in pure Lua.
-- http://www.json.org/
--
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local lua_value = JSON:decode(raw_json_text)
--
-- local raw_json_text = JSON:encode(lua_table_or_value)
-- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability
--
--
-- DECODING
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local lua_value = JSON:decode(raw_json_text)
--
-- If the JSON text is for an object or an array, e.g.
-- { "what": "books", "count": 3 }
-- or
-- [ "Larry", "Curly", "Moe" ]
--
-- the result is a Lua table, e.g.
-- { what = "books", count = 3 }
-- or
-- { "Larry", "Curly", "Moe" }
--
--
-- The encode and decode routines accept an optional second argument, "etc", which is not used
-- during encoding or decoding, but upon error is passed along to error handlers. It can be of any
-- type (including nil).
--
-- With most errors during decoding, this code calls
--
-- JSON:onDecodeError(message, text, location, etc)
--
-- with a message about the error, and if known, the JSON text being parsed and the byte count
-- where the problem was discovered. You can replace the default JSON:onDecodeError() with your
-- own function.
--
-- The default onDecodeError() merely augments the message with data about the text and the
-- location if known (and if a second 'etc' argument had been provided to decode(), its value is
-- tacked onto the message as well), and then calls JSON.assert(), which itself defaults to Lua's
-- built-in assert(), and can also be overridden.
--
-- For example, in an Adobe Lightroom plugin, you might use something like
--
-- function JSON:onDecodeError(message, text, location, etc)
-- LrErrors.throwUserError("Internal Error: invalid JSON data")
-- end
--
-- or even just
--
-- function JSON.assert(message)
-- LrErrors.throwUserError("Internal Error: " .. message)
-- end
--
-- If JSON:decode() is passed a nil, this is called instead:
--
-- JSON:onDecodeOfNilError(message, nil, nil, etc)
--
-- and if JSON:decode() is passed HTML instead of JSON, this is called:
--
-- JSON:onDecodeOfHTMLError(message, text, nil, etc)
--
-- The use of the fourth 'etc' argument allows stronger coordination between decoding and error
-- reporting, especially when you provide your own error-handling routines. Continuing with the
-- the Adobe Lightroom plugin example:
--
-- function JSON:onDecodeError(message, text, location, etc)
-- local note = "Internal Error: invalid JSON data"
-- if type(etc) = 'table' and etc.photo then
-- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName')
-- end
-- LrErrors.throwUserError(note)
-- end
--
-- :
-- :
--
-- for i, photo in ipairs(photosToProcess) do
-- :
-- :
-- local data = JSON:decode(someJsonText, { photo = photo })
-- :
-- :
-- end
--
--
--
--
-- DECODING AND STRICT TYPES
--
-- Because both JSON objects and JSON arrays are converted to Lua tables, it's not normally
-- possible to tell which a Lua table came from, or guarantee decode-encode round-trip
-- equivalency.
--
-- However, if you enable strictTypes, e.g.
--
-- JSON = (loadfile "JSON.lua")() --load the routines
-- JSON.strictTypes = true
--
-- then the Lua table resulting from the decoding of a JSON object or JSON array is marked via Lua
-- metatable, so that when re-encoded with JSON:encode() it ends up as the appropriate JSON type.
--
-- (This is not the default because other routines may not work well with tables that have a
-- metatable set, for example, Lightroom API calls.)
--
--
-- ENCODING
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local raw_json_text = JSON:encode(lua_table_or_value)
-- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability
-- On error during encoding, this code calls:
--
-- JSON:onEncodeError(message, etc)
--
-- which you can override in your local JSON object.
--
--
-- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT
--
-- assert
-- onDecodeError
-- onDecodeOfNilError
-- onDecodeOfHTMLError
-- onEncodeError
--
-- If you want to create a separate Lua JSON object with its own error handlers,
-- you can reload JSON.lua or use the :new() method.
--
---------------------------------------------------------------------------
local author = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json), version " .. tostring(VERSION) .. " ]-"
local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray
local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject
function OBJDEF:newArray(tbl)
return setmetatable(tbl or {}, isArray)
end
function OBJDEF:newObject(tbl)
return setmetatable(tbl or {}, isObject)
end
local function unicode_codepoint_as_utf8(codepoint)
--
-- codepoint is a number
--
if codepoint <= 127 then
return string.char(codepoint)
elseif codepoint <= 2047 then
--
-- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8
--
local highpart = math.floor(codepoint / 0x40)
local lowpart = codepoint - (0x40 * highpart)
return string.char(0xC0 + highpart,
0x80 + lowpart)
elseif codepoint <= 65535 then
--
-- 1110yyyy 10yyyyxx 10xxxxxx
--
local highpart = math.floor(codepoint / 0x1000)
local remainder = codepoint - 0x1000 * highpart
local midpart = math.floor(remainder / 0x40)
local lowpart = remainder - 0x40 * midpart
highpart = 0xE0 + highpart
midpart = 0x80 + midpart
lowpart = 0x80 + lowpart
--
-- Check for an invalid character (thanks Andy R. at Adobe).
-- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070
--
if ( highpart == 0xE0 and midpart < 0xA0 ) or
( highpart == 0xED and midpart > 0x9F ) or
( highpart == 0xF0 and midpart < 0x90 ) or
( highpart == 0xF4 and midpart > 0x8F )
then
return "?"
else
return string.char(highpart,
midpart,
lowpart)
end
else
--
-- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx
--
local highpart = math.floor(codepoint / 0x40000)
local remainder = codepoint - 0x40000 * highpart
local midA = math.floor(remainder / 0x1000)
remainder = remainder - 0x1000 * midA
local midB = math.floor(remainder / 0x40)
local lowpart = remainder - 0x40 * midB
return string.char(0xF0 + highpart,
0x80 + midA,
0x80 + midB,
0x80 + lowpart)
end
end
function OBJDEF:onDecodeError(message, text, location, etc)
if text then
if location then
message = string.format("%s at char %d of: %s", message, location, text)
else
message = string.format("%s: %s", message, text)
end
end
if etc ~= nil then
message = message .. " (" .. OBJDEF:encode(etc) .. ")"
end
if self.assert then
self.assert(false, message)
else
assert(false, message)
end
end
OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError
OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError
function OBJDEF:onEncodeError(message, etc)
if etc ~= nil then
message = message .. " (" .. OBJDEF:encode(etc) .. ")"
end
if self.assert then
self.assert(false, message)
else
assert(false, message)
end
end
local function grok_number(self, text, start, etc)
--
-- Grab the integer part
--
local integer_part = text:match('^-?[1-9]%d*', start)
or text:match("^-?0", start)
if not integer_part then
self:onDecodeError("expected number", text, start, etc)
end
local i = start + integer_part:len()
--
-- Grab an optional decimal part
--
local decimal_part = text:match('^%.%d+', i) or ""
i = i + decimal_part:len()
--
-- Grab an optional exponential part
--
local exponent_part = text:match('^[eE][-+]?%d+', i) or ""
i = i + exponent_part:len()
local full_number_text = integer_part .. decimal_part .. exponent_part
local as_number = tonumber(full_number_text)
if not as_number then
self:onDecodeError("bad number", text, start, etc)
end
return as_number, i
end
local function grok_string(self, text, start, etc)
if text:sub(start,start) ~= '"' then
self:onDecodeError("expected string's opening quote", text, start, etc)
end
local i = start + 1 -- +1 to bypass the initial quote
local text_len = text:len()
local VALUE = ""
while i <= text_len do
local c = text:sub(i,i)
if c == '"' then
return VALUE, i + 1
end
if c ~= '\\' then
VALUE = VALUE .. c
i = i + 1
elseif text:match('^\\b', i) then
VALUE = VALUE .. "\b"
i = i + 2
elseif text:match('^\\f', i) then
VALUE = VALUE .. "\f"
i = i + 2
elseif text:match('^\\n', i) then
VALUE = VALUE .. "\n"
i = i + 2
elseif text:match('^\\r', i) then
VALUE = VALUE .. "\r"
i = i + 2
elseif text:match('^\\t', i) then
VALUE = VALUE .. "\t"
i = i + 2
else
local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i)
if hex then
i = i + 6 -- bypass what we just read
-- We have a Unicode codepoint. It could be standalone, or if in the proper range and
-- followed by another in a specific range, it'll be a two-code surrogate pair.
local codepoint = tonumber(hex, 16)
if codepoint >= 0xD800 and codepoint <= 0xDBFF then
-- it's a hi surrogate... see whether we have a following low
local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i)
if lo_surrogate then
i = i + 6 -- bypass the low surrogate we just read
codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16)
else
-- not a proper low, so we'll just leave the first codepoint as is and spit it out.
end
end
VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint)
else
-- just pass through what's escaped
VALUE = VALUE .. text:match('^\\(.)', i)
i = i + 2
end
end
end
self:onDecodeError("unclosed string", text, start, etc)
end
local function skip_whitespace(text, start)
local match_start, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2
if match_end then
return match_end + 1
else
return start
end
end
local grok_one -- assigned later
local function grok_object(self, text, start, etc)
if not text:sub(start,start) == '{' then
self:onDecodeError("expected '{'", text, start, etc)
end
local i = skip_whitespace(text, start + 1) -- +1 to skip the '{'
local VALUE = self.strictTypes and self:newObject { } or { }
if text:sub(i,i) == '}' then
return VALUE, i + 1
end
local text_len = text:len()
while i <= text_len do
local key, new_i = grok_string(self, text, i, etc)
i = skip_whitespace(text, new_i)
if text:sub(i, i) ~= ':' then
self:onDecodeError("expected colon", text, i, etc)
end
i = skip_whitespace(text, i + 1)
local val, new_i = grok_one(self, text, i)
VALUE[key] = val
--
-- Expect now either '}' to end things, or a ',' to allow us to continue.
--
i = skip_whitespace(text, new_i)
local c = text:sub(i,i)
if c == '}' then
return VALUE, i + 1
end
if text:sub(i, i) ~= ',' then
self:onDecodeError("expected comma or '}'", text, i, etc)
end
i = skip_whitespace(text, i + 1)
end
self:onDecodeError("unclosed '{'", text, start, etc)
end
local function grok_array(self, text, start, etc)
if not text:sub(start,start) == '[' then
self:onDecodeError("expected '['", text, start, etc)
end
local i = skip_whitespace(text, start + 1) -- +1 to skip the '['
local VALUE = self.strictTypes and self:newArray { } or { }
if text:sub(i,i) == ']' then
return VALUE, i + 1
end
local text_len = text:len()
while i <= text_len do
local val, new_i = grok_one(self, text, i)
table.insert(VALUE, val)
i = skip_whitespace(text, new_i)
--
-- Expect now either ']' to end things, or a ',' to allow us to continue.
--
local c = text:sub(i,i)
if c == ']' then
return VALUE, i + 1
end
if text:sub(i, i) ~= ',' then
self:onDecodeError("expected comma or '['", text, i, etc)
end
i = skip_whitespace(text, i + 1)
end
self:onDecodeError("unclosed '['", text, start, etc)
end
grok_one = function(self, text, start, etc)
-- Skip any whitespace
start = skip_whitespace(text, start)
if start > text:len() then
self:onDecodeError("unexpected end of string", text, nil, etc)
end
if text:find('^"', start) then
return grok_string(self, text, start, etc)
elseif text:find('^[-0123456789 ]', start) then
return grok_number(self, text, start, etc)
elseif text:find('^%{', start) then
return grok_object(self, text, start, etc)
elseif text:find('^%[', start) then
return grok_array(self, text, start, etc)
elseif text:find('^true', start) then
return true, start + 4
elseif text:find('^false', start) then
return false, start + 5
elseif text:find('^null', start) then
return nil, start + 4
else
self:onDecodeError("can't parse JSON", text, start, etc)
end
end
function OBJDEF:decode(text, etc)
if type(self) ~= 'table' or self.__index ~= OBJDEF then
OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc)
end
if text == nil then
self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc)
elseif type(text) ~= 'string' then
self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc)
end
if text:match('^%s*$') then
return nil
end
if text:match('^%s*<') then
-- Can't be JSON... we'll assume it's HTML
self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc)
end
--
-- Ensure that it's not UTF-32 or UTF-16.
-- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3),
-- but this package can't handle them.
--
if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then
self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc)
end
local success, value = pcall(grok_one, self, text, 1, etc)
if success then
return value
else
-- should never get here... JSON parse errors should have been caught earlier
assert(false, value)
return nil
end
end
local function backslash_replacement_function(c)
if c == "\n" then
return "\\n"
elseif c == "\r" then
return "\\r"
elseif c == "\t" then
return "\\t"
elseif c == "\b" then
return "\\b"
elseif c == "\f" then
return "\\f"
elseif c == '"' then
return '\\"'
elseif c == '\\' then
return '\\\\'
else
return string.format("\\u%04x", c:byte())
end
end
local chars_to_be_escaped_in_JSON_string
= '['
.. '"' -- class sub-pattern to match a double quote
.. '%\\' -- class sub-pattern to match a backslash
.. '%z' -- class sub-pattern to match a null
.. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters
.. ']'
local function json_string_literal(value)
local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function)
return '"' .. newval .. '"'
end
local function object_or_array(self, T, etc)
--
-- We need to inspect all the keys... if there are any strings, we'll convert to a JSON
-- object. If there are only numbers, it's a JSON array.
--
-- If we'll be converting to a JSON object, we'll want to sort the keys so that the
-- end result is deterministic.
--
local string_keys = { }
local seen_number_key = false
local maximum_number_key
for key in pairs(T) do
if type(key) == 'number' then
seen_number_key = true
if not maximum_number_key or maximum_number_key < key then
maximum_number_key = key
end
elseif type(key) == 'string' then
table.insert(string_keys, key)
else
self:onEncodeError("can't encode table with a key of type " .. type(key), etc)
end
end
if seen_number_key and #string_keys > 0 then
--
-- Mixed key types... don't know what to do, so bail
--
self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc)
elseif #string_keys == 0 then
--
-- An array
--
if seen_number_key then
return nil, maximum_number_key -- an array
else
--
-- An empty table...
--
if tostring(T) == "JSON array" then
return nil
elseif tostring(T) == "JSON object" then
return { }
else
-- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects
return nil
end
end
else
--
-- An object, so return a list of keys
--
table.sort(string_keys)
return string_keys
end
end
--
-- Encode
--
local encode_value -- must predeclare because it calls itself
function encode_value(self, value, parents, etc)
if value == nil then
return 'null'
end
if type(value) == 'string' then
return json_string_literal(value)
elseif type(value) == 'number' then
if value ~= value then
--
-- NaN (Not a Number).
-- JSON has no NaN, so we have to fudge the best we can. This should really be a package option.
--
return "null"
elseif value >= math.huge then
--
-- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should
-- really be a package option. Note: at least with some implementations, positive infinity
-- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is.
-- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">="
-- case first.
--
return "1e+9999"
elseif value <= -math.huge then
--
-- Negative infinity.
-- JSON has no INF, so we have to fudge the best we can. This should really be a package option.
--
return "-1e+9999"
else
return tostring(value)
end
elseif type(value) == 'boolean' then
return tostring(value)
elseif type(value) ~= 'table' then
self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc)
else
--
-- A table to be converted to either a JSON object or array.
--
local T = value
if parents[T] then
self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc)
else
parents[T] = true
end
local result_value
local object_keys, maximum_number_key = object_or_array(self, T, etc)
if maximum_number_key then
--
-- An array...
--
local ITEMS = { }
for i = 1, maximum_number_key do
table.insert(ITEMS, encode_value(self, T[i], parents, etc))
end
result_value = "[" .. table.concat(ITEMS, ",") .. "]"
elseif object_keys then
--
-- An object
--
--
-- We'll always sort the keys, so that comparisons can be made on
-- the results, etc. The actual order is not particularly
-- important (e.g. it doesn't matter what character set we sort
-- as); it's only important that it be deterministic... the same
-- every time.
--
local PARTS = { }
for _, key in ipairs(object_keys) do
local encoded_key = encode_value(self, tostring(key), parents, etc)
local encoded_val = encode_value(self, T[key], parents, etc)
table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val))
end
result_value = "{" .. table.concat(PARTS, ",") .. "}"
else
--
-- An empty array/object... we'll treat it as an array, though it should really be an option
--
result_value = "[]"
end
parents[T] = false
return result_value
end
end
local encode_pretty_value -- must predeclare because it calls itself
function encode_pretty_value(self, value, parents, indent, etc)
if type(value) == 'string' then
return json_string_literal(value)
elseif type(value) == 'number' then
return tostring(value)
elseif type(value) == 'boolean' then
return tostring(value)
elseif type(value) == 'nil' then
return 'null'
elseif type(value) ~= 'table' then
self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc)
else
--
-- A table to be converted to either a JSON object or array.
--
local T = value
if parents[T] then
self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc)
end
parents[T] = true
local result_value
local object_keys = object_or_array(self, T, etc)
if not object_keys then
--
-- An array...
--
local ITEMS = { }
for i = 1, #T do
table.insert(ITEMS, encode_pretty_value(self, T[i], parents, indent, etc))
end
result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]"
else
--
-- An object -- can keys be numbers?
--
local KEYS = { }
local max_key_length = 0
for _, key in ipairs(object_keys) do
local encoded = encode_pretty_value(self, tostring(key), parents, "", etc)
max_key_length = math.max(max_key_length, #encoded)
table.insert(KEYS, encoded)
end
local key_indent = indent .. " "
local subtable_indent = indent .. string.rep(" ", max_key_length + 2 + 4)
local FORMAT = "%s%" .. tostring(max_key_length) .. "s: %s"
local COMBINED_PARTS = { }
for i, key in ipairs(object_keys) do
local encoded_val = encode_pretty_value(self, T[key], parents, subtable_indent, etc)
table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val))
end
result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}"
end
parents[T] = false
return result_value
end
end
function OBJDEF:encode(value, etc)
if type(self) ~= 'table' or self.__index ~= OBJDEF then
OBJDEF:onEncodeError("JSON:encode must be called in method format", etc)
end
local parents = {}
return encode_value(self, value, parents, etc)
end
function OBJDEF:encode_pretty(value, etc)
local parents = {}
local subtable_indent = ""
return encode_pretty_value(self, value, parents, subtable_indent, etc)
end
function OBJDEF.__tostring()
return "JSON encode/decode package"
end
OBJDEF.__index = OBJDEF
function OBJDEF:new(args)
local new = { }
if args then
for key, val in pairs(args) do
new[key] = val
end
end
return setmetatable(new, OBJDEF)
end
return OBJDEF:new()
--
-- Version history:
--
-- 20111207.5 Added support for the 'etc' arguments, for better error reporting.
--
-- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent.
--
-- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules:
--
-- * When encoding lua for JSON, Sparse numeric arrays are now handled by
-- spitting out full arrays, such that
-- JSON:encode({"one", "two", [10] = "ten"})
-- returns
-- ["one","two",null,null,null,null,null,null,null,"ten"]
--
-- In 20100810.2 and earlier, only up to the first non-null value would have been retained.
--
-- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999".
-- Version 20100810.2 and earlier created invalid JSON in both cases.
--
-- * Unicode surrogate pairs are now detected when decoding JSON.
--
-- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding
--
-- 20100731.1 initial public release
--
cb2c3d084de7f3f42a582991115e86de7740d004
Module:TableTools
828
67
149
2019-07-16T11:22:04Z
mw>4nn1l2
0
Changed protection level for "[[Module:TableTools]]": downgraded protection level per [[Special:Permalink/357548402|consensus]] ([Move=Allow only template editors and administrators] (indefinite) [Edit=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
if type(v) == 'number' and tostring(v) == '-nan' then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
return p
ab9df0eb210b08945b9eed86435858f6e931a79a
502
149
2020-07-05T13:26:49Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
return type(v) == 'number' and tostring(v) == '-nan'
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
else -- This will fail with table, boolean, function.
return item1 < item2
end
end
--[[
Returns a list of the keys in a table, sorted using either a default
comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
end
local list = {}
local index = 1
for key, value in pairs(t) do
list[index] = key
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(list, keySort)
end
return list
end
--[[
Iterates through a table, with the keys sorted using the keysToList function.
If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local list = p.keysToList(t, keySort, true)
local i = 0
return function()
i = i + 1
local key = list[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
--[[
Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
checkType("isArray", 1, t, "table")
local i = 0
for k, v in pairs(t) do
i = i + 1
if t[i] == nil then
return false
end
end
return true
end
-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
checkType("invert", 1, array, "table")
local map = {}
for i, v in ipairs(array) do
map[v] = i
end
return map
end
--[[
{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
checkType("listToSet", 1, t, "table")
local set = {}
for _, item in ipairs(t) do
set[item] = true
end
return set
end
--[[
Recursive deep copy function.
Preserves identities of subtables.
]]
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = deepcopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
--[[
Concatenates all values in the table that are indexed by a number, in order.
sparseConcat{ a, nil, c, d } => "acd"
sparseConcat{ nil, b, c, d } => "bcd"
]]
function p.sparseConcat(t, sep, i, j)
local list = {}
local list_i = 0
for _, v in p.sparseIpairs(t) do
list_i = list_i + 1
list[list_i] = v
end
return table.concat(list, sep, i, j)
end
--[[
-- Finds the length of an array, or of a quasi-array with keys such
-- as "data1", "data2", etc., using an exponential search algorithm.
-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]]
-- which is only needed by this one function
-- doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function(i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
ad3062fee63cdfb979a1543abf96236cf7bf609d
Template:Documentation/styles.css
10
38
91
2019-08-16T10:34:50Z
mw>Kwj2772
0
Protected "[[Template:Documentation/styles.css]]": [[Commons:Protection policy|Widely used template]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
text
text/plain
.template-documentation {
margin-top: 1em;
clear: both;
border: 2px dotted #666;
padding: 0.6em;
background-color: #ecfcf4;
}
.template-documentation:after {
content: "";
display: block;
clear: both;
}
.template-documentation-heading {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.template-documentation-title {
font-size: 150%;
}
.template-documentation-transcludedfrom {
font-size: smaller;
font-style: italic;
}
937a4c089853e87d6903631231b1de77089e938a
Template:Lua
10
125
442
293
2020-01-14T13:29:04Z
templatewiki>Rob Kam
0
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Module:List
828
168
476
2020-01-14T13:29:25Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist hlist-separated')
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
0d6c114450d0f5b3c1d2171ebeb41ae74f203f88
Template:Anchor
10
70
155
2020-02-14T10:43:51Z
mw>Ahmad252
0
Now working with [[Module:Anchor]] instead
wikitext
text/x-wiki
{{{{{|safesubst:}}}#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
6b59a8a0f344484cb585cdf542e35cc889526d88
Module:Anchor
828
82
179
2020-02-14T17:00:59Z
mw>Tacsipacsi
0
still accept {{{anchor}}}, used e.g. on [[Commons:European Science Photo Competition 2015/Winners]]
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
args[1] = args[1] or args.anchor
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
1745d8c9a981c79c49af1d0921d54a38de7b8981
Template:Documentation
10
35
285
2020-04-01T06:12:34Z
en>MusikAnimal
0
1 revision imported
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
434
285
2021-02-14T04:02:53Z
templatewiki>Pppery
0
164 revisions imported from [[:wikipedia:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
ce7fd93f18c46b4fa871bf679afd05cbda72d8c4
Template:Para
10
128
301
2020-04-01T06:12:37Z
en>MusikAnimal
0
1 revision imported
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
448
301
2021-02-14T04:08:24Z
templatewiki>Pppery
0
21 revisions imported from [[:wikipedia:Template:Para]]
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
Module:Arguments
828
83
333
2020-04-01T06:12:40Z
en>MusikAnimal
0
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
460
333
2021-02-14T03:43:55Z
templatewiki>Pppery
0
24 revisions imported from [[:wikipedia:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
181
2021-02-19T00:52:50Z
mw>Magog the Ogre
0
2 revisions imported from [[:w:en:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Effective protection expiry
828
148
345
2020-04-01T06:12:42Z
en>MusikAnimal
0
1 revision imported
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Module:Namespace detect/config
828
194
486
2020-04-01T06:12:44Z
imported>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
195
488
2020-04-01T06:12:45Z
imported>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Navbar
828
161
490
2020-04-01T06:30:21Z
imported>MusikAnimal
0
Undid revision 948472521 by [[Special:Contributions/w>MusikAnimal|w>MusikAnimal]] ([[User talk:w>MusikAnimal|talk]])
Scribunto
text/plain
local p = {}
local getArgs
local ul
function p.addItem (mini, full, link, descrip, args, url)
local l
if url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-'..full)
:wikitext(l[1] .. link .. l[2])
:tag(args.mini and 'abbr' or 'span')
:attr('title', descrip..' this template')
:cssText(args.fontstyle)
:wikitext(args.mini and mini or full)
:done()
:wikitext(l[3])
end
function p.brackets (position, c, args, div)
if args.brackets then
div
:tag('span')
:css('margin-'..position, '-0.125em')
:cssText(args.fontstyle)
:wikitext(c)
end
end
function p._navbar(args)
local show = {true, true, true, false, false, false}
local titleArg = 1
if args.collapsible then
titleArg = 2
if not args.plain then args.mini = 1 end
if args.fontcolor then
args.fontstyle = 'color:' .. args.fontcolor .. ';'
end
args.style = 'float:left; text-align:left'
end
if args.template then
titleArg = 'template'
show = {true, false, false, false, false, false}
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6, talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
for k,v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
if args.noedit then show[3] = false end
local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local title = mw.title.new(mw.text.trim(titleText), 'Template')
if not title then
error('Invalid title ' .. titleText)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
local div = mw.html.create():tag('div')
div
:addClass('plainlinks')
:addClass('hlist')
:addClass('navbar')
:cssText(args.style)
if args.mini then div:addClass('mini') end
if not (args.mini or args.plain) then
div
:tag('span')
:css('word-spacing', 0)
:cssText(args.fontstyle)
:wikitext(args.text or 'This box:')
:wikitext(' ')
end
p.brackets('right', '[ ', args, div)
ul = div:tag('ul')
if show[1] then p.addItem('v', 'view', title.fullText, 'View', args) end
if show[2] then p.addItem('t', 'talk', talkpage, 'Discuss', args) end
if show[3] then p.addItem('e', 'edit', title:fullUrl('action=edit'), 'Edit', args, true) end
if show[4] then p.addItem('h', 'hist', title:fullUrl('action=history'), 'History of', args, true) end
if show[5] then
local move = mw.title.new ('Special:Movepage')
p.addItem('m', 'move', move:fullUrl('target='..title.fullText), 'Move', args, true) end
if show[6] then p.addItem('w', 'watch', title:fullUrl('action=watch'), 'Watch', args, true) end
p.brackets('left', ' ]', args, div)
if args.collapsible then
div
:done()
:tag('div')
:css('font-size', '114%')
:css('margin', args.mini and '0 4em' or '0 7em')
:cssText(args.fontstyle)
:wikitext(args[1])
end
return tostring(div:done())
end
function p.navbar(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return p._navbar(getArgs(frame))
end
return p
04f3b81927127526bd5d8bda44128b559fc97d0d
Module:File link
828
150
349
2020-04-01T06:31:54Z
en>MusikAnimal
0
Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Template:Sandbox other
10
130
305
2020-04-03T00:08:09Z
en>Evad37
0
Also match subpage names beginning with "sandbox", per [[Template_talk:Sandbox_other#Template-protected_edit_request_on_28_March_2020|edit request]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Tlf
10
138
323
2020-04-13T14:42:57Z
en>Primefac
0
Primefac moved page [[Template:Tlf]] to [[Template:Template link with link off]]: full name to indicate what it does
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Module:Languages
828
63
141
2020-05-02T23:57:00Z
mw>Verdy p
0
Scribunto
text/plain
--[=[
Not globally exposed. Internal function only.
language_subpages( frame, transform, options )
Parameters
frame: The frame that was passed to the method invoked. The first argument or the page argument will be respected.
transform: A transform function. Example: function( basepagename, subpagename, code, langname ) end
options: An object with options. Example: { abort= { on=function() end, time=0.8 } }
Following options are available:
abort: Aborts iterating over the subpages if one of the conditions is met. If the process is aborted, nil is returned!
on: Function to be called if an abort-condition was met.
cycles: The maximum number of subpages to run over.
time: Maximum time to spend running over the subpages.
]=]
function language_subpages( frame, transform, options )
local args, pargs, options = frame.args, ( frame:getParent() or {} ).args or {}, options or {};
local title = args.page or args[1] or pargs.page or pargs[1] or "";
local abort = options.abort or {};
local at, clock = type( abort.on ), os.clock();
local ac = function()
if at == 'function' or ( at == 'table' and getmetatable(abort.on).__call ) then
abort.on();
end
end
local tt = type( transform );
local page = require( 'Module:Page' );
title = page.clean(title);
if tt == 'function' or ( tt == 'table' and getmetatable(transform).__call ) then
local fetch, pages, langcode, langname = mw.language.fetchLanguageName, {};
--[==[
/ \
/ | \
/ · \
¯¯¯¯¯¯¯
Page.subpages() no longer works because it attempted to parse the HTML content generated by
calling the parser function "Special:Prefixindex:" which is no longer expanded in Lua but
converted to a "stripped tag" (containing a unique identifier surrounded by ASCII DEL characters)
representing the tag name and its parameters.
The actual expansion of stripped tags can no longer be performed in Lua.
Now unstripping these tags just kills ALL these tags (except "wiki" tags) instead of performing
their expansion by running the extension code. Only MediaWiki can unstrip these tags in texts after
they have been returned by Lua.
For this reason, page.subpages() is now completely empty (Module:Page no longer works).
This cannot be bypassed, except by using a Scribunto extension library if lifting the limits set by mw.unstrip.
Note that "Special:Prefixindex:" is also costly, even if it just requires a single database query to
get all subpages, instead of one costly #ifexist or one costly mw.title() property reading per
tested subpage to know if it exists.
For now there's still no reliable way to get a list of subpages, or performing queries similar to
the [[Special:Prefixindex]] page or list members of a category like when viewing a category page.
Ideally, there should exist a method for such queries on Title objects returned by the mw.title library;
but for now there's none.
In Lua now, the only expansion possible with an immediate effect is the expansion of standard templates,
all special tags or special pages, or parser function extensions do not work (Only the #expr parser
function is supported by using an external Scribunto library).
--]==]
for pg in page.subpages( title, { ignoreNS=true } ) do
if abort.cycles then
abort.cycles = abort.cycles - 1
if 0 == abort.cycles then return ac() end
end
if abort.time then
if (os.clock() - clock) > abort.time then return ac() end
end
if mw.ustring.len( pg ) <= 12 then
langcode = string.lower( pg );
langname = fetch( langcode );
if langname ~= '' then
table.insert( pages, transform( title, pg, langcode, langname ) );
end
end
end
return pages;
end
return {};
end
function cloneArgs(frame)
local args, pargs = {}, {}
for k,v in pairs( frame.args ) do args[k] = v end
if frame:getParent() then
for k,v in pairs( frame:getParent().args ) do pargs[k] = v end
end
return args, pargs
end
local p = {};
--[=[
Usage:
{{#invoke:languages|internal|Template:Adjective}}
]=]
function p.internal(frame)
return table.concat(
language_subpages( frame,
function( title, page, code, name )
return mw.ustring.format(
'<bdi class="language lang-%s" lang="%s">[[%s/%s|%s]]</bdi>',
code, code,
title, page,
name
);
end
),
' <b>·</b> '
);
end
--[=[
Usage:
{{#invoke:languages|external|Template:Adjective}}
]=]
function p.external(frame)
return table.concat(
language_subpages( frame,
function( title, page, code, name )
return mw.ustring.format(
'<bdi class="language lang-%s" lang="%s">[%s/%s %s]</bdi>',
code, code,
tostring( mw.uri.fullUrl( title ) ), page:gsub( ' ', '_' ),
name
);
end
),
' <b>·</b> '
);
end
--[=[
forEachLanguage
This function iterates over all language codes known to MediaWiki based on a maintained list
replacing patterns in a pattern-string for each language
Usage
{{#invoke:Languages|forEachLanguage
|pattern=patternstring
|before=string to insert before iteration
|after=string added after iteration
|sep=separator string between iterations
|inLang=langcode used for $lnTrP and $lnTrUC1
}}
Parameters
pattern: A pattern string which is processed for each language and which is concatenated at the end and returned as one string
before: A string that is inserted before the concatenated result
after: A string that is inserted after the concatenated result
sep: A string that is inserted between each line created from the pattern while iterating (like ProcessedPattern_sep_ProcessedPattern_sep_ProcessedPattern)
inLang: Langcode to use for $lnTrP and $lnTrUC1
preprocess: if set to a non-empty value, the output will be preprocessed before being returned.
Warning
The output is still not prepreprocessed by default: so parser functions and magic keywords generated by the pattern are still not executed and replaced,
and template transclusions are still not expanded (see examples in other functions in this module).
When using this function directly from a MediaWiki page or template, this means it is only possible to use patterns generating basic MediaWiki formatting
or HTML tags. It you want the output to be preprocessed (in the given frame), set the preprocess parameter to a non-empty string.
Patterns
$lc - language code such as en or de
$lnP - language name in own language (autonym)
$lnUC1 - language name in own language (autonym), first letter upper case
$lnTrP - language name translated to the language requested by language code passed to inLang
$lnTrUC1 - language name translated to the language requested by language code passed to inLang, first letter upper case
Example
{{#invoke:Languages|forEachLanguage|pattern=<span lang="$lc" xml:lang="$lc" class="language lang-$lc">[[Page/$lc|$lnP]]</span>}}
]=]
-- =p.forEachLanguage({ args= { pattern = "$lc - $lnTrP\n", inLang = "en" } })
function p.forEachLanguage(frame)
local l = require("Module:Languages/List")
local ret = {}
local lang = mw.language
local line
local pattern = frame.args.pattern or frame.args[1] or ""
local prefix = frame.args.before or frame.args[2] or ""
local postfix = frame.args.after or frame.args[3] or ""
local sep = frame.args.sep or frame.args.separator or frame.args[4] or ""
local inLang = frame.args.inLang or frame.args[5] or nil
local preprocess = frame.args.preprocess or frame.args[6] or ""
local langNameUCFirstReq = not not pattern:find( "$lnUC1", 1, true )
local langNameReq = not not pattern:find( "$lnP", 1, true ) or langNameUCFirstReq
local langNameTranslatedUCFirstReq = not not pattern:find( "$lnTrUC1", 1, true )
local langNameTranslatedReq = not not pattern:find( "$lnTrP", 1, true ) or langNameTranslatedUCFirstReq
local contentLangInstance = mw.language.getContentLanguage()
local inLangLangInstance
local l = mw.language.fetchLanguageNames() -- autonyms
local lTr
local lcIdList = require('Module:Languages/List').getSortedList( l )
if langNameTranslatedReq then
inLangLangInstance = --[==[
mw.getLanguage( inLang ) -- Quota hit in :ucfirst() if using too many langInstances
--]==] contentLangInstance
lTr = mw.language.fetchLanguageNames( inLang ) -- translated names
end
for _, lcId in pairs( lcIdList ) do
local subst = lcId:gsub('%%', '%%%%')
line = pattern:gsub( "%$lc", subst )
local langName, langInstance
-- autonym (name of lcId in locale lcId)
if langNameReq then
langName = l[lcId]
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnP", subst )
end
if langNameUCFirstReq then
langInstance = --[==[
mw.getLanguage( lcId ) -- Quota hit in :ucfirst() if using too many langInstances
--]==] contentLangInstance
langName = langInstance:ucfirst( langName )
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnUC1", subst )
end
-- translated name (name of lcId in locale inLang)
if langNameTranslatedReq then
langName = lTr[lcId]
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnTrP", subst )
end
if langNameTranslatedUCFirstReq then
langName = inLangLangInstance:ucfirst( langName )
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnTrUC1", subst )
end
table.insert(ret, line)
end
ret = prefix .. table.concat( ret, sep ) .. postfix
if preprocess ~= '' then
ret = frame:preprocess(ret)
end
return ret
end
--[=[
Provide logic for [[Template:Lle]] (Language Links external, to be substituted, language names written exactly as #language would provide them)
Warning: may expands too many costly #ifexist without limitation (if not substituted into a separate "/lang" template)
]=]
function p.lle(frame)
return frame:preprocess(
p.forEachLanguage({
args = {
pattern = '{{subst:#ifexist:{{{1}}}/$lc|[{{subst:fullurl:{{{1}}}/$lc}} <bdi class="language lang-$lc" lang="$lc">$lnP</bdi>] <b>∙</b> <!--\n-->}}'
}
})
)
end
--[=[
Provide logic for [[Template:Ll]] (Language Links internal, to be substituted, language names written exactly as #language would provide them)
Warning: may expands too many costly #ifexist without limitation (if not substituted into a separate "/lang" template)
]=]
function p.ll(frame)
return frame:preprocess(
p.forEachLanguage({
args = {
pattern = '{{subst:#ifexist:{{{1}}}/$lc|[[{{{1}}}/$lc|<bdi class="language lang-$lc" lang="$lc">$lnP</bdi>]] <b>∙</b> <!--\n-->}}'
}
})
)
end
--------------------------------------------------------
--- Different approaches for [[Template:Lang links]] ---
--------------------------------------------------------
--[=[
Provide logic for [[Template:Lang links]]
Using a cute Hybrid-Method:
First check the subpages which is quite fast; if there are too many fall back to checking for each language page individually
]=]
-- =p.langLinksNonExpensive({ args= { page='Commons:Picture of the Year/2010' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='Main Page' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='Template:No_source_since' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='MediaWiki:Gadget-HotCat' }, getParent=function() end })
function p.langLinksNonExpensive(frame)
local args, pargs = frame.args, ( frame:getParent() or {} ).args or {};
local title = args.page or args[1] or pargs.page or pargs[1] or "";
local contentLangInstance = mw.language.getContentLanguage();
local pages2
if frame.preprocess == nil then
frame = mw.getCurrentFrame()
end
--[==[
local options = {
abort = {
time = 3.5,
on = function()
pages2 = p.forEachLanguage({
args = {
pattern = '{{#ifexist:' .. title .. '/$lc|[[' .. title .. '/$lc|<bdi lang="$lc">$lnP</bdi>]] <b>∙</b> }}'
}
})
end
}
}
local pages = language_subpages( frame,
function( title, page, code, langname )
return mw.ustring.format(
'[[%s/%s|<bdi lang="%s">%s</bdi>]]</span> <b>∙</b> ',
title, page, code, langname
)
end, options );
return pages2 and frame:preprocess(pages2) or table.concat(pages, '');
--]==]
return frame:preprocess(
p.forEachLanguage( {
args = {
pattern = '{{#ifexist:' .. title .. '/$lc|[[' .. title .. '/$lc|<bdi lang="$lc">$lnP</bdi>]] <b>∙</b> }}'
}
})
)
end
---------------------------------------------------------
----------------- [[Template:Autolang]] -----------------
---------------------------------------------------------
--[[
Works like {{autotranslate}} just allowing an unlimited number of arguments, even named arguments.
It's doing Magic! No arguments should be passed to {{#invoke:}}
]]
function p.autolang(frame)
local args, pargs = cloneArgs( frame )
if nil == args.useargs then
if not args.base then args = pargs end
elseif 'both' == args.useargs then
for k,v in pairs(args) do pargs[k] = v end
args = pargs
elseif 'parent' == args.useargs then
args = pargs
if pargs.base and not args.base then
args.base = pargs.base
end
end
local base = args.base
local userlang = frame:preprocess( '{{Int:Lang}}' )
local tl, tlns = 'Template:', 10
local tlb, fallback1, currenttemplate
local fallback, contentlang = mw.text.split( userlang, '-', true )[1], mw.language.getContentLanguage():getCode()
local createReturn = function(title)
local ret
local tlargs = {}
-- When LUA is invoked, templates are already expanded. This must be respected.
return frame:expandTemplate{ title = title, args = args }
end
if not base then
return ("'autolang' in [[Module:Languages]] was called but the 'base' parameter could not be found." ..
"The base parameter specifies the template that's subpages will be sought for a suitable translation.")
end
tlb = tl .. base .. '/'
currenttemplate = tlb .. userlang
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
fallback1 = frame:preprocess( '{{Fallback|1=' .. base .. '|2=' .. userlang .. '}}' )
if fallback1 ~= contentlang then
return createReturn(tlb .. fallback1)
end
currenttemplate = tlb .. fallback
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
currenttemplate = tlb .. contentlang
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
return createReturn(tl .. base)
end
--[=[
Usage:
{{#invoke:languages|isKnownLanguageTag|gsw}} -> 1
{{#invoke:languages|isKnownLanguageTag|doesNotExist}} ->
]=]
function p.isKnownLanguageTag(frame)
return mw.language.isKnownLanguageTag( frame.args[1] or frame.args.tag or frame.args.code or '' ) and '1' or ''
end
function p.file_languages(frame)
local M_link = require( 'Module:Link' )
local contentLangInstance = mw.language.getContentLanguage()
local pattern = frame.args.pattern or '%s (%s)'
local original = frame.args.original or mw.title.getCurrentTitle().text
local ext_start, _ = string.find( original, '\.%w+$' )
local file_ext = string.sub( original, ext_start )
original = string.sub( original, 0, ext_start - 1 )
return frame:preprocess(
'<gallery>\n' ..
(table.concat(
M_link.forEachLink(
p.forEachLanguage({
args = { pattern = '[[$lc]]' }
}),
function( linkInfo )
local filename = mw.ustring.format( pattern, original, linkInfo.text ) .. file_ext
local ok, exists = pcall( function()
return mw.title.new( filename, 6 ).exists
end )
if ok and exists then
return mw.ustring.format( '%s|%s',
filename,
mw.language.fetchLanguageName( linkInfo.text )
)
else
return nil
end
end
), '\n'
)) ..
'\n</gallery>'
)
end
function p.runTests()
return p.langLinksNonExpensive({
args = {
page = 'Module:Languages/testcases/test'
},
getParent = function() end
}) ==
'[[Module:Languages/testcases/test/de|<bdi lang="de">Deutsch</bdi>]] <b>∙</b> ' ..
'[[Module:Languages/testcases/test/en|<bdi lang="en">English</bdi>]] <b>∙</b> '
end
return p;
705eceab8ff681939d35feb55e6209ca506ef16d
Template:Sidebar
10
131
307
2020-06-04T02:43:13Z
en>Primefac
0
TFD closed as keep ([[WP:XFDC|XFDcloser]])
wikitext
text/x-wiki
{{#invoke:Sidebar|sidebar}}<noinclude>
{{documentation}}</noinclude>
ab2498000a99daf324f656b0badd187b4a3e2b42
Module:Lua banner
828
166
478
2020-07-05T13:26:47Z
templatewiki>Rob Kam
0
1 revision imported
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Lua String-based templates',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation'] = 'Lua-based citation templates'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
aaf9d18b952effc2a0bc890e66040f403c1e8a69
Module:TNT
828
65
145
2020-08-14T13:52:16Z
mw>Jarekt
0
Protected "[[Module:TNT]]": [[Commons:Protection policy|High-risk Lua module]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
Template:Yesno
10
140
327
2020-08-28T03:15:17Z
en>Xaosflux
0
add additional paramerters, "t", "f" - requested on talk - worked in sandbox /testcases
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Template:Protected
10
41
97
2020-08-30T07:53:41Z
mw>Steinsplitter
0
Fulfilling [[Template:Edit request|edit request]] by [[User:Sarang|Sarang]]. Thanks for helping!
wikitext
text/x-wiki
{{#switch:{{{demo-edit|{{PROTECTIONLEVEL:edit}}}}}
| sysop=
{{#ifeq:{{{icon}}}|no||<indicator name="protected">[[File:Full-protection-shackle-block.svg|20px|link=Special:MyLanguage/Commons:Protection policy|{{{{tSwitch|protected/text}}|img-text1}}]]</indicator>}}
<table class="protected" style="direction: {{dir|{{int:Lang}}}}; background:#fff; border:1px solid #aaa; padding:.2em; margin:.5em auto;">
<tr>
<td style="padding-right:4px; padding-left:4px;">[[File:Full-protection-shackle-block.svg|40px|link=COM:P|Protected]]</td>
<td>'''{{{{tSwitch|protected/text}}|text1}} {{#if:{{{1|}}}|{{{{tSwitch|protected/text}}|reason|reason={{{1}}}}}|{{{{tSwitch|protected/text}}|default-reason}}}}'''<br /><span style="font-size:90%;">{{{note|{{{{tSwitch|protected/text}}|text2}} }}}</span></td>
</tr>
</table>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|{{#switch:{{NAMESPACE}}|{{ns:6}}=[[Category:Protected files]]|{{ns:2}}|{{ns:3}}|{{ns:10}}=|[[Category:Protected pages]]}} }}} }}
| templateeditor=
<indicator name="protected">[[File:Template-protection-shackle-brackets 2.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text1}}]]</indicator>
| autoconfirmed=
<indicator name="protected">[[File:Semi-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text2}}]]</indicator>
| #default=
{{#ifeq:{{NAMESPACE}}|{{{demo-ns|{{ns:6}}}}}
| {{#switch:{{{demo-upload|{{PROTECTIONLEVEL:upload}}}}}
| sysop=
<indicator name="protected">[[File:Upload-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text3}}]]</indicator>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Upload protected files]]}}} }}
| autoconfirmed=
<indicator name="protected">[[File:Semi-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text4}}]]</indicator>
| #default={{ifsandbox||
<div class="error">{{{{tSwitch|protected/text}}|error-text}}</div>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Unprotected pages using protection templates]]}}} }}}}
}}
|{{ifsandbox||<div class="error">{{{{tSwitch|protected/text}}|error-text}}</div>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Unprotected pages using protection templates]]}}} }}}}
}}
}}<noinclude>
{{documentation}}
</noinclude>
bdc1d224afd2702accce70992774468ea129c15b
Module:Effective protection level
828
149
347
2020-09-29T03:38:47Z
en>Jackmcbarn
0
bring in changes from sandbox
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Module:Documentation/styles.css
828
147
343
2020-11-19T20:21:58Z
en>Izno
0
Changed protection level for "[[Module:Documentation/styles.css]]": actually match module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
468
343
2021-01-24T17:57:41Z
templatewiki>Rob Kam
0
1 revision imported
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Template:Tlx
10
139
325
2020-11-20T18:53:35Z
en>Primefac
0
Primefac moved page [[Template:Tlx]] to [[Template:Template link expanded]] over redirect: expand name, make it more obvious
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Template link expanded
10
134
313
2020-11-21T12:04:41Z
en>Primefac
0
update
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Template link with link off
10
135
315
2020-11-21T12:06:17Z
en>Primefac
0
update
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Module:Caller title
828
62
139
2020-12-15T06:31:52Z
mw>CptViraj
0
Protected "[[Module:Caller title]]": [[Commons:Protection policy|High-risk Lua module]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
local p = {}
function p.title(frame)
return frame:getParent():getTitle()
end
function p.lang(frame)
local base = frame.args.base
local title = p.title(frame)
if base ~= title then
local parts = mw.text.split(p.title(frame), '/', true)
return parts[#parts]
else
-- we’re on the base page of the translation (directly, it’s not translated from somewhere),
-- so we have no subpage language code, but we use PAGELANGUAGE
return frame:preprocess('{{PAGELANGUAGE}}')
end
end
return p
cda968cdcb51987e070fd2e22be310ef9b870974
Template:Div col/styles.css
10
121
281
2021-01-05T04:54:19Z
en>Izno
0
remove the note as not generally necessary
sanitized-css
text/css
/* {{pp|small=yes}} */
.div-col {
margin-top: 0.3em;
column-width: 30em;
}
.div-col-small {
font-size: 90%;
}
.div-col-rules {
column-rule: 1px solid #aaa;
}
/* Reset top margin for lists in div col */
.div-col dl,
.div-col ol,
.div-col ul {
margin-top: 0;
}
/* Avoid elements breaking between columns
See also Template:No col break */
.div-col li,
.div-col dd {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
c6c2dc0cb2bab7a5f7b4eb938eebc5c67df087bc
MediaWiki:Lang
8
89
193
2021-01-18T05:48:32Z
mw>Otourly
0
[[Commons:Rollback|Reverted]] edits by [[Special:Contributions/Otourly|Otourly]] ([[User talk:Otourly|talk]]) to last revision by ABF
wikitext
text/x-wiki
en
094b0fe0e302854af1311afab85b5203ba457a3b
Template:Tl
10
54
321
123
2021-02-12T22:03:00Z
en>Anthony Appleyard
0
Anthony Appleyard moved page [[Template:Tl]] to [[Template:Template link]]: [[Special:Permalink/1006428669|Requested]] by Buidhe at [[WP:RM/TR]]: RM closed as move
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
456
321
2021-02-14T03:50:57Z
templatewiki>Pppery
0
[[mw:m:Special:MyLanguage/Help:Edit summary#Automatic summaries|←]]Redirected page to [[Template:Template link]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
Module:Documentation
828
145
464
2021-02-14T02:46:19Z
templatewiki>Pppery
0
141 revisions imported
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
-- env.printTitle - the print version of the template, located at the /Print subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.printTitle()
--[[
-- Title object for the /Print subpage.
-- Messages:
-- 'print-subpage' --> 'Print'
--]]
return env.templateTitle:subPageTitle(message('print-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 6 then -- File namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
if printBlurb then
text = text .. '<br />' .. printBlurb
end
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
function p.makePrintBlurb(args, env)
--[=[
-- Generates the blurb displayed when there is a print version of the template available.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'print-link-display' --> '/Print'
-- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]'
-- .. ' of this template exists at $1.'
-- .. ' If you make a change to this template, please update the print version as well.'
-- 'display-print-category' --> true
-- 'print-category' --> 'Templates with print versions'
--]=]
local printTitle = env.printTitle
if not printTitle then
return nil
end
local ret
if printTitle.exists then
local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))
ret = message('print-blurb', {printLink})
local displayPrintCategory = message('display-print-category', nil, 'boolean')
if displayPrintCategory then
ret = ret .. makeCategoryLink(message('print-category'))
end
end
return ret
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
5580b450d7e0e93d5b2243d04e59493523a57d20
Module:Documentation/config
828
146
466
2021-02-14T02:52:17Z
templatewiki>Pppery
0
41 revisions imported from [[:wikipedia:Module:Documentation/config]]: Re-import history from one wiki only and with correct interwiki prefix
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload']
-- Preload file for documentation page in the file namespace.
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- Print version configuration
----------------------------------------------------------------------------------------------------
-- cfg['print-subpage']
-- The name of the template subpage used for print versions.
cfg['print-subpage'] = 'Print'
-- cfg['print-link-display']
-- The text to display when linking to the /Print subpage.
cfg['print-link-display'] = '/Print'
-- cfg['print-blurb']
-- Text to display if a /Print subpage exists. $1 is a link to the subpage with
-- a display value of cfg['print-link-display'].
cfg['print-blurb'] = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1.'
.. ' If you make a change to this template, please update the print version as well.'
-- cfg['display-print-category']
-- Set to true to enable output of cfg['print-category'] if a /Print subpage exists.
-- This should be a boolean value (either true or false).
cfg['display-print-category'] = true
-- cfg['print-category']
-- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists.
cfg['print-category'] = 'Templates with print versions'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
936dcd942da0ad844cd212849cde5e2dc1e45c3d
Module:Yesno
828
159
504
2021-02-14T03:13:26Z
templatewiki>Pppery
0
28 revisions imported from [[:wikipedia:Module:Yesno]]
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:No globals
828
64
492
2021-02-14T03:33:06Z
templatewiki>Pppery
0
9 revisions imported from [[:wikipedia:Module:No_globals]]
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
143
2021-02-19T00:52:53Z
mw>Magog the Ogre
0
4 revisions imported from [[:w:en:Module:No_globals]]
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
Module:Message box/configuration
828
169
482
2021-02-14T03:36:40Z
templatewiki>Pppery
0
28 revisions imported from [[:wikipedia:Module:Message_box/configuration]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
imageEmptyCellStyle = true,
templateCategory = 'Talk message boxes'
}
}
ef8171b8278c52d9c20a4149614d97cd948670c2
Template:Template link
10
133
454
2021-02-14T03:51:14Z
templatewiki>Pppery
0
40 revisions imported from [[:wikipedia:Template:Template_link]]
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
91be693cd63410db06fc933eddb412ba433564dc
Template:Documentation subpage
10
39
436
2021-02-14T03:59:35Z
templatewiki>Pppery
0
136 revisions imported from [[:wikipedia:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
'''This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]] for {{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}'''.<br />It contains usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
a1dda2f5e5ddf9097546af5acd7a7bad14fdac9d
Module:Message box
828
165
480
2021-02-14T04:21:35Z
templatewiki>Pppery
0
66 revisions imported from [[:wikipedia:Module:Message_box]]
Scribunto
text/plain
-- This is a meta-module for producing message box templates, including
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
-- Load necessary modules.
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
-- Get a language object for formatDate and ucfirst.
local lang = mw.language.getContentLanguage()
-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {user = 'tmbox', talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <small class='date-container'>''(<span class='date'>%s</span>)''</small>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'
end
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
:cssText(self.imageEmptyCellStyle or nil)
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) and not self.isSmall then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('small')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):css('width', '52px')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:css('text-align', 'center')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
e2473750afb1ad26d0a3a13cb843ae0025b75606
Template:Div col
10
120
279
2021-02-14T23:20:57Z
en>Matt Fitzpatrick
0
whitelist parameter class
wikitext
text/x-wiki
<includeonly><templatestyles src="Div col/styles.css"/><!--
--><div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}} {{{class|}}}" <!--
-->{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|<!--
-->style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"<!--
-->}}><!--
-->{{#if:{{{content|}}}|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes
-->{{#ifeq:{{{small|}}}|yes|[[Category:Pages using div col with small parameter]]}}<!--
--></includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using div col with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Div col]] with unknown parameter "_VALUE_"; use colwidth= to specify column size |ignoreblank=y | class | colwidth | content | gap | rules | small | style }}<noinclude>
{{Documentation}}
</noinclude>
6e84133dd867d6c701e7b161878cf66665bb7eb7
Template:Template link
10
133
311
2021-03-25T19:03:22Z
en>Izno
0
[[Wikipedia:Templates for discussion/Log/2021 March 18#Template:Tlu]] closed as keep ([[WP:XFDC#4.0.11|XFDcloser]])
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Infobox/doc
10
124
440
2021-06-07T20:24:28Z
templatewiki>Pppery
0
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[w:Help:Infobox]] contains an introduction about the recommended content and design of infoboxes.
== Usage ==
Usage is similar to {{tl|navbox}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored.
To insert an image somewhere other than at the top of the infobox, or to insert freeform data, use a row with only a data field.
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For accessibility reasons, this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[mw:Help:Extension:ParserFunctions##if|here]].
==== Hiding headers when all data fields are hidden ====
You can also make headers optional in a similar way. Consider this example:
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an undesirable header
| header1 = Undesirable header
| label2 = Item 1 | data2 =
| label3 = Item 2 | data3 =
| label4 = Item 3 | data4 =
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
| label2 = Item 1 | data2 = {{{item1|}}}
| label3 = Item 2 | data3 = {{{item2|}}}
| label4 = Item 3 | data4 = {{{item3|}}}
| header5 = Static header
| label6 = Static item | data6 = Static value
}}
</pre>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next static content. The trick to this is that the "#if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invocation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "autohide header1 = yes", for example, would remove the need to perform the "#if" test so that we can just to define "header1 = Optional header"),
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
=== HTML classes and microformats ===
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
To flag an infobox as containing [[w:hCard|hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[w:microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</pre>{{clear}}
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<pre style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</pre>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<source lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</source>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
==See also==
* [[Module:Infobox]], the [[mw:Lua/Overview|Lua]] module on which this template is based
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Metatemplates|Infobox]]
}}</includeonly>
825bc5d31d155ac2366a6abc56736ae77bb7897b
291
2021-12-10T22:35:31Z
en>Fayenatic london
0
/* See also */ update category
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old ||{{High-use|3408796|all-pages=yes}}{{Lua|Module:Infobox}}}}</includeonly>
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
{{tlf|Infobox}} is a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|Infobox building}}).
For <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, template code then looks like this, simplified:
<pre>
{{Infobox
| name = {{{name|{{PAGENAME}}}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| label1 = Former names
| data1 = {{{former_names|}}}
| header2 = General information
| label3 = Status
| data3 = {{{status|}}}
... <!-- etc. -->
}}
</pre>
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however, this is rarely what you want because it will send users clicking these links in an infobox to the template code rather than the data in the infobox they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
; autoheaders: If this is set to any non-blank value, headers which are not followed by data fields are suppressed. See the "[[#Hiding headers when all its data fields are empty|hiding headers when all its data fields are empty]]" section for more details.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts it as a caption on top of the table. You can use them both together, or just one or the other, or neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all its data fields are empty ====
You can also make headers automatically hide when their section is empty (has no data-row showing).
Consider this situation:
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</pre>{{clear}}
If you want hide the header when no {{para|data''N''}} values are present, use '''{{para|autoheaders|y}}''':
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</syntaxhighlight>{{clear}}
So, header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next visible content.
Note: if the data has empty css elements, like {{para|data|2=<span style="background:yellow;"></span>}}, this will be treated as non-empty (having data).
If {{para|autoheaders|y}} but there are items that you ''do not'' want to trigger a header, place {{para|headerX|_BLANK_}}. This will serve as an empty header and separate it from the subsequent items.
{{Infobox
| title = Example: blank header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
</syntaxhighlight>{{clear}}
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
{{div col}}
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; subheaderstyle : Applies to all subheader cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
{{div col end}}
=== HTML classes and microformats ===
{{div col}}
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
{{div col end}}
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others being used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<syntaxhighlight lang="Sass" style="overflow:auto" highlight="15">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</syntaxhighlight>{{clear}}
For this example, the {{para|bodystyle}} and {{para|labelstyle}} parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<syntaxhighlight lang="sass" highlight="3,9" style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</syntaxhighlight>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation. The garbage output can be suppressed using {{para|rowstyleN|display: none}}, replacing N with the data/header number.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</syntaxhighlight>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</syntaxhighlight>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| templatestyles =
| child templatestyles =
| grandchild templatestyles =
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.",
"format": "{{_\n| ________________ = _\n}}\n",
"params": {
"title": {
"label": "Title",
"description": "Title displayed above the infobox",
"type": "string",
"suggested": true
}
},
"paramOrder": [
"title"
]
}
</templatedata>
==Tracking categories==
* {{Category link with count|Articles with missing Wikidata information}}
* {{Category link with count|Articles using infobox templates with no data rows}}
* {{Category link with count|Pages using embedded infobox templates with the title parameter}}
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Module:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
<includeonly>{{Sandbox other||
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
[[Category:Templates that add a tracking category]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
4916f93a28dc7393586e49c6c637705d88b5e3e9
Template:Category link with count
10
117
273
2021-06-11T18:13:44Z
en>GKFX
0
Support wider range of (valid) input format
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Template:Clickable button 2/doc
10
73
161
2021-06-23T11:39:52Z
mw>Vis M
0
see also
wikitext
text/x-wiki
{{TemplateBox
|name = Clickable button 2
|desc-de = Diese Vorlage erlaubt es, auf einfache Weise (ohne HTML- oder CSS-Kenntnisse) Schaltflächen (Buttons) zu erstellen, welche die Verlinkung beliebiger Inhalte auf Wikipedia, sowie auf externen Seiten erlauben. Damit können z.B. Projekt- und Benutzerseiten visuell ansprechend präsentiert werden.
Zur grafischen Gestaltung stehen viele vordefinierte Icons zur Verfügung, alternativ können beliebige lokal gespeicherte oder auf Commons verfügbare Grafiken eingebunden werden. Weiterhin stellt die Vorlage drei verschiedene Farbschemata in mehreren Variationen zur Verfügung. Der Linktext kann beliebig mit Wikitext und/oder HTML/CSS gestaltet werden.
|desc-en = This template allows creating buttons that link to Commons-internal pages, or external pages without HTML and CSS knowledge. Project or user pages can be visually enhanced using this button, for example.
A bunch of predefined icons and, additionally any graphic hosted at Wikimedia Commons can be included to further enhance the User Experience (UX). On top of that, the template provides 3 different color schemas, each of them with different variants. The link text can be customized using wiki text and/or HTML/CSS.
|1 = link
|1aliases = 1
|1d-de = Gibt das Linkziel an. Erlaubt ist
* entweder ein Wikilink (ohne die doppelten Klammern <code><nowiki>[[…]]</nowiki></code>), z.B. einfach <code>"link = Wikipedia"</code> um auf die Seite der [[Wikipedia]]-Galerie zu gelangen, oder
* ein externer Link (ohne die einfachen Klammern <code><nowiki>[…]</nowiki></code>), z.B. einfach <code><nowiki>"link = https://test.de"</nowiki></code> um auf https://test.de zu verlinken.
|1d-td-de = Gibt das Linkziel an. Erlaubt ist
* entweder ein Wikilink (ohne die doppelten Klammern <code><nowiki>[[…]]</nowiki></code>), z.B. einfach <code>"link = Wikipedia"</code> um auf die Seite der Wikipedia-Galerie zu gelangen, oder
* ein externer Link (ohne die einfachen Klammern <code><nowiki>[…]</nowiki></code>), z.B. einfach <code><nowiki>"link = https://test.de"</nowiki></code> um auf https://test.de zu verlinken.
|1d-en = Specifies the link target:
* Either a wiki link (without double square brackets <code><nowiki>[[…]]</nowiki></code>), e.g. simply <code>"link = Wikipedia"</code> for a link to the [[Wikipedia]] gallery page, or
* an external link (without the square brackets <code><nowiki>[…]</nowiki></code>), e.g. simply <code><nowiki>"link = https://example.com"</nowiki></code> for a link to https://example.com.
|1d-td-en = Specifies the link target:
* Either a wiki link (without double square brackets <code><nowiki>[[…]]</nowiki></code>), e.g. simply <code>"link = Wikipedia"</code> for a link to the Wikipedia gallery page, or
* an external link (without the square brackets <code><nowiki>[…]</nowiki></code>), e.g. simply <code><nowiki>"link = https://example.com"</nowiki></code> for a link to https://example.com.
|1def=Main Page
|1type = string/wiki-page-name
|1stat = required
|2 = text
|2aliases = 2
|2d-de = Der Text, den der Button enthalten soll.<br />Der Linktext kann beliebig mit Wikitext und/oder HTML/CSS gestaltet werden.<br />Es ist auch eine leere Angabe <code><nowiki>text=</nowiki></code> möglich, wenn der Button nur ein Icon oder Bild enthalten soll.
|2d-en = The text the button should display.<br />Can be customized using wiki text and/or HTML/CSS.<br />Also an empty text parameter <code><nowiki>text=</nowiki></code> is permitted if only a graphic or an icon should be displayed.
|2def = Button
|2type = string
|2stat = optional
|3 = title
|3aliases = Titel
|3d-de = Der Text, welcher als Tooltip erscheinen soll.<br />Standardmäßig wird der Seitentitel (Wikilink) bzw. die URL (externer Link) angezeigt.
|3d-en = Text for the tooltip. By default the page title (wiki links) or the URL (external inks) is displayed.
|3def = (link target)
|3type = string
|3stat = optional-
|4 =icon
|4d-de = Der Name eines vordefinierten Icons, welches auf dem Button erscheinen soll (z.B. <code>"icon = refresh"</code> für <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />''[[#icons|→ Liste der Icons]]''
|4d-td-de = Der Name eines vordefinierten Icons, welches auf dem Button erscheinen soll (z.B. <code>"icon = refresh"</code> für <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />Siehe Liste der Icons in der Dokumentation dieser Vorlage.
|4d-en = Name of a pre-defined icon, which should be shown on the button (e.g. <code>"icon = refresh"</code> for <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />''[[#icons|→ Icon list]]''
|4d-td-en = Name of a pre-defined icon, which should be shown on the button (e.g. <code>"icon = refresh"</code> for <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />See icon list in documentation of this template.
|4type = string
|4stat = optional-
|5 = image
|5aliases = Bild
|5d-de = Ein auf Commons vorhandenes Bild, welches auf dem Button angezeigt werden soll.<br />Die Einbindung erfolgt inklusive Größenangabe mit Wikisyntax (z.B. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code> für [[File:checkmark.svg|16px|link=|middle]]).
|5d-td-de = Ein auf Commons vorhandenes Bild, welches auf dem Button angezeigt werden soll.<br />Die Einbindung erfolgt inklusive Größenangabe mit Wikisyntax (z.B. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code>).
|5d-en = A file on Commons and its dimensions. Inclusion using Wiki-Syntax (e.g. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code> for [[File:checkmark.svg|16px|link=|middle]]).
|5d-td-en = A file on Commons and its dimensions. Inclusion using Wiki-Syntax (e.g. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code>).
|5type = string
|5stat = optional-
|6 = color
|6aliases = Farbe
|6d-de = Gibt ein Farbschema für den Button vor (z.B. <code>"color = blue"</code>).<br />Mögliche Werte sind <code>rot/red/blau/blue/grün/green</code>, <code>rot2/red2/blau2/blue2/grün2/green2</code> sowie <code>rot3/red3/blau3/blue3/grün3/green3</code> (siehe [[#colors|Abschnitt]] in den Verwendungshinweisen).
|6d-td-de = Gibt ein Farbschema für den Button vor (z.B. <code>"color = blue"</code>).<br />Mögliche Werte sind <code>rot/red/blau/blue/grün/green</code>, <code>rot2/red2/blau2/blue2/grün2/green2</code> sowie <code>rot3/red3/blau3/blue3/grün3/green3</code> (siehe entsprechenden Abschnitt in den Verwendungshinweisen).
|6d-en = Specifies the color-scheme for the button (z.B. <code>"color = blue"</code>).<br />Possible values are <code>red/blue/green</code>, <code>red2/blue2/green2</code>, and also <code>red3/blue3/green3</code> or their German counterparts (see [[#colors|section]] in usage notes).
|6d-td-en = Specifies the color-scheme for the button (z.B. <code>"color = blue"</code>).<br />Possible values are <code>red/blue/green</code>, <code>red2/blue2/green2</code>, and also <code>red3/blue3/green3</code> or their German counterparts (see regarding section in usage notes).
|6type = string
|6stat = optional-
|7 = padding
|7d-de = Gibt den Abstand zwischen Inhalt (Text, Bild, Icon) und dem Rand des Buttons an.<br /><code>"padding = 5px"</code> ergibt fünf Pixel breite Ränder auf allen Seiten. Werden zwei Werte angegeben (<code>"padding = 5px 5px"</code>) gelten diese für oben/unten bzw. links/rechts, Werden vier Werte angegeben (<code>"padding = 5px 5px 5px 5px"</code>) gelten diese für oben, rechts, unten bzw. links in dieser Reihenfolge.
|7d-en = Specifies the padding between content (text, graphic, icon) and border of the button. If one value is given it coubts for all sides, Two values are for top/bottom and left/right respectively. Four values count for top, right, bottom and left in this order (e.g. <code>"padding = 5px 15px 10px 20px"</code>).
|7def = 0.25em 0.5em
|7type = string
|7stat = optional-
|namespace = all
|usergroup = all
|usage-notes =
|type = formatting
|example = link=Main page|text=Link to Main Page
|example-value = {{Clickable button 2|link=Main page|text=Link to Main Page}}
|i18n-method = -
|seealso =
* {{tl|Button}} - just using CSS.
* {{tl|Clickable button}} - previous attempt.
* {{tl|Clickable button 3}} - mw.ui buttons, most recent version
* {{tl|Key press}}
|setscats =
|print = one
|relieson =
* [[Module:FileUtil]]
* [[Module:URLutil]]
|useTemplateData = 1
}}
== {{anchor|Verwendungshinweise}}{{anchor|Usage notes}}<!--
-->{{LangSwitch
|de=Verwendungshinweise
|en=Usage notes
}} ==
=== {{anchor|Grundlegende Verwendung}}<!--
-->{{anchor|Basic usage}}<!--
-->{{LangSwitch
|de=Grundlegende Verwendung
|en=Basic usage
}} ===
<ul>
<li>
'''Wikilinks, Interwikilinks {{and}} external links:'''<br />
<code><nowiki>{{Clickable button 2|link=Wikipedia|text=</nowiki>{{LangSwitch |de=Link zur Wikipedia-Galerie |en=Link to Wikipedia Gallery}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|text={{LangSwitch |de=Link zur Wikipedia-Galerie |en=Link to Wikipedia Gallery}} }}<br />
<code><nowiki>{{Clickable button 2|link=:en:Wikipedia|text=</nowiki>{{LangSwitch |de=Link zum Artikel <nowiki>''Wikipedia''</nowiki> in der englischen Wikipedia |en=Link to article <nowiki>''Wikipedia''</nowiki> in English Wikpedia}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|link=:en:Wikipedia|text={{LangSwitch |de=Link zum Artikel ''Wikipedia'' in der englischen Wikipedia |en=Link to article ''Wikipedia'' in English Wikipedia}} }}<br />
<code><nowiki>{{Clickable button 2|link=https://example.com|text=</nowiki>{{LangSwitch |de=Link zu |en=Link to}} <nowiki><kbd>https://example.com</kbd>}}</nowiki></code><br />
{{Clickable button 2|link=https://example.com|text={{LangSwitch |de=Link zu |en=Link to}} <kbd>https://example.com</kbd>}}
</li>
<li>
'''{{LangSwitch
|de=Die notwendigen Parameter<code>"link"</code> und <code>"text"</code> können benannte oder unbenannte Parameter sein:
|en=Required parameters <code>"link"</code> and <code>"text"</code> may be named parameters or unnamed params:
}}'''<br />
<code><nowiki>{{Clickable button 2|Wikipedia|Wikipedia-Galerie}}</nowiki></code> {{i18n/or}}<br />
<code><nowiki>{{Clickable button 2|1=Wikipedia|2=Wikipedia-Galerie}}</nowiki></code> {{i18n/or}}<br />
<code><nowiki>{{Clickable button 2|link=Wikipedia|text=Wikipedia-Galerie}}</nowiki></code><br />
{{Clickable button 2|Wikipedia|Wikipedia-Galerie}}
</li>
<li>
'''Tooltips:'''<br />
<code><nowiki>{{Clickable button 2|link=:en:Wikipedia|text=''Wikipedia''|title=</nowiki>{{LangSwitch |de=Link zum Artikel über die Wikipedia in der englischen Wikipedia |en=Link to article about Wikipedia in English Wikipedia}}<nowiki>&nbsp;:-) }}</nowiki></code><br />
{{Clickable button 2|link=:en:Wikipedia|text=''Wikipedia''|title={{LangSwitch |de=Link zum Artikel über die Wikipedia in der englischen Wikipedia |en=Link to article about Wikipedia in English Wikipedia}} :-) }}<!--
--> ''← {{LangSwitch
|de=Bitte mit der Maus auf die Schaltfläche gehen.
|en=Please hover the button.
}}''
</li>
</ul>
=== {{anchor|Fortgeschrittene Verwendung (URL-Parameter)}}<!--
-->{{anchor|Advanced usage (URL parameters)}}<!--
-->{{LangSwitch
|de=Fortgeschrittene Verwendung (URL-Parameter)
|en=Advanced usage (URL parameters)
}} ===
{{LangSwitch
|de=Um URL-Parameter angeben zu können, müssen auch Wikilinks in „externe“ URL umgewandelt werden. Diese können von Hand zusammengesetzt werden, einfacher und zuverlässiger geht es aber mit der
|en=To be able to specify URL parameters, also Wikilinks must be converted to "external" URLs. These can be assembled by hand, but it's easier and more reliable with the
}} [[:mw:Special:MyLanguage/Help:Magic words#Parser functions|<!--
-->{{LangSwitch
|de=Parserfunktion
|en=parser function
}}]] <code><nowiki>{{fullurl}}</nowiki></code>.
{{LangSwitch
|de=Beispielsweise liefert
|en=For instance yields
}}
* {{LangSwitch
|de=<code><nowiki>{{fullurl:Hauptseite}}</nowiki></code> die volle URL der Hauptseite: <code>{{fullurl:Hauptseite}}</code>
|en=<code><nowiki>{{fullurl:Main Page}}</nowiki></code> the full URL of the main page: <code>{{fullurl:Main Page}}</code>
}}
* <code><nowiki>{{fullurl:{{FULLPAGENAME}}}}</nowiki></code> <!--
-->{{LangSwitch
|de=die volle URL der aktuellen Seite:
|en=the full URL of current page:
}} <code>{{fullurl:{{FULLPAGENAME}}}}</code>
{{LangSwitch
|de=Über den ersten Parameter von <code><nowiki>{{fullurl}}</nowiki></code> können URL-Parameter an die URL angehängt werden:
|en=The first parameter of <code><nowiki>{{fullurl}}</nowiki></code> can be used to append URL parameters to the URL:
}}
*<code><nowiki>{{fullurl:Hauptseite|action=purge}}</nowiki></code> → <code>{{fullurl:Hauptseite|action=purge}}</code>
*<code><nowiki>{{fullurl:{{FULLPAGENAME}}|action=purge}}</nowiki></code> → <code>{{fullurl:{{FULLPAGENAME}}|action=purge}}</code>
{{LangSwitch
|de=Damit lässt sich nun einfach ein Button erstellen, der den Server-Cache der aktuellen Seite löscht:
|en=So it is easily possible to create a button that deletes the server cache of the current page:
}}<br />
<code><nowiki>{{Clickable button 2|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|text=</nowiki>{{LangSwitch |de=Cache leeren |en=Clear cache}}<nowiki>|icon=refresh}}</nowiki></code><br />
{{Clickable button 2|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|text={{LangSwitch |de=Cache leeren |en=Clear cache}}|icon=refresh}}<!--
--> ''← {{LangSwitch
|de=Dieser Button leert den Cache der aktuellen Seite.
|en=This button clears the cache of the current page.
}}''
{{LangSwitch
|de=Weitere hilfreiche URL-Parameter, die auf diese Weise mit Hilfe eines Buttons einfach zur Verfügung gestellt werden können, sind auf [[:de:Hilfe:URL-Parameter]] erklärt (siehe auch [[:mw:Manual:Parameters to index.php/de|Manual:Parameters to index.php/de]] auf Mediawiki). Es ist zu beachten, dass URL-Parameter, die Leerzeichen oder andere geschützte Zeichen wie <code>&</code> oder <code>?</code> enthalten, mit der Parserfunktion <code><nowiki>{{urlencode}}</nowiki></code> encodiert werden müssen!
|en=More helpful URL parameters, which can be easily provided with the help of a button, are explained in [[:mw:Manual:Parameters to index.php/de|Manual:Parameters to index.php]] on Mediawiki. Note that URL parameters containing spaces or other protected characters like <code>&</code> or <code>?</code> must be encoded with the parser function <code><nowiki>{{urlencode}}</nowiki></code>!
}}
=== {{anchor|Icons und Grafiken}}<!--
-->{{anchor|Icons and graphics}}<!--
-->{{LangSwitch
|de=Icons und Grafiken
|en=Icons and graphics
}} ===
<ul>
<li>
'''Icons'''<br />
<code><nowiki>{{Clickable button 2 | … |icon=mail-closed}}</nowiki></code><!--
--> → {{Clickable button 2|icon=mail-closed}}<br />
<code><nowiki>{{Clickable button 2 | … |text=|icon=mail-closed}}</nowiki></code><!--
--> → {{Clickable button 2|text=|icon=mail-closed}}<br />
''{{LangSwitch
|de=Zu möglichen Werten für <code>icon</code> siehe die [[#icons|Übersicht]] unten.
|en=For possible values of <code>icon</code> see [[#icons|overview]] below.
}}''
</li>
<li>
'''{{LangSwitch |de=Bilder |en=Images}}'''<br />
<code><nowiki>{{Clickable button 2 | … |image=[[File:checkmark.svg|18px]]}}</nowiki></code><!--
--> → {{Clickable button 2|image=[[File:checkmark.svg|18px]]}}<br />
<code><nowiki>{{Clickable button 2 | … |text=|image=[[File:checkmark.svg|30px]]}}</nowiki></code><!--
--> → {{Clickable button 2|text=|image=[[File:checkmark.svg|30px]]}}
</li>
</ul>
=== {{anchor|Farben und Innenabstand}}<!--
-->{{anchor|Colors and padding}}<!--
-->{{LangSwitch
|de=Farben und Innenabstand
|en=Colors and Padding
}} ===
<ul>
<li>{{anchor|colors}}
'''{{LangSwitch
|de=Farbschemata
|en=Color schemes}}:'''<br />
<code><nowiki>{{Clickable button 2 | … |color=</nowiki>{{LangSwitch |de=(Farbname) |en=(color name)}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|text='''red''' |color=red |padding=20px 33px}}
{{Clickable button 2|text='''green''' |color=green |padding=20px 33px}}
{{Clickable button 2|text='''blue''' |color=blue |padding=20px 33px}}<br />
{{Clickable button 2|text='''red2''' |color=red2 |padding=20px 30px}}
{{Clickable button 2|text='''green2''' |color=green2|padding=20px 30px}}
{{Clickable button 2|text='''blue2 ''' |color=blue2 |padding=20px 30px}}<br />
{{Clickable button 2|text='''red3''' |color=red3 |padding=20px 30px}}
{{Clickable button 2|text='''green3''' |color=green3|padding=20px 30px}}
{{Clickable button 2|text='''blue3''' |color=blue3 |padding=20px 30px}}
</li>
<li>
'''Padding:'''<br />
<div style="display:flex; flex-wrap: wrap;">
<div style="display: inline-block; width: 25em;">
<code><nowiki>{{Clickable button 2 | … |padding=0px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=10px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=0px}}
{{Clickable button 2|link=Wikipedia|padding=10px}}
{{Clickable button 2|link=Wikipedia|padding=20px}}
</div>
<div style="display: inline-block; width: 27em;">
<code><nowiki>{{Clickable button 2 | … |padding=20px 0px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0px 20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=20px 0px}}
{{Clickable button 2|link=Wikipedia|padding=0px 20px}}
</div>
<div style="display: inline-block; width: 28.5em;">
<code><nowiki>{{Clickable button 2 | … |padding=20px 0 0 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 0 20px 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 20px 0 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 0 0 20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=20px 0 0 0}}
{{Clickable button 2|link=Wikipedia|padding=0 0 20px 0}}
{{Clickable button 2|link=Wikipedia|padding=0 20px 0 0}}
{{Clickable button 2|link=Wikipedia|padding=0 0 0 20px}}
</div>
</div>
</li>
</ul>
== {{anchor|icons}}{{anchor|Iconübersicht}}<!--
-->{{anchor|Icons overview}}<!--
-->{{LangSwitch
|de=Iconübersicht
|en=Icons overview
}} ==
'''{{LangSwitch
|de=Mögliche Werte für
|en=Possible values for
}} <code>icon</code>:'''
{{Clickable button 2/Icons}}
<includeonly>
<!-- Interwikis go on Wikidata, please add only Categories here -->
[[Category:Formatting templates]]
</includeonly>
14c532d2a814ce692f9dbe761cf6817e5ce80750
Template:Clickable button/doc
10
32
79
2021-06-23T11:47:22Z
mw>Vis M
0
see also * [[Template:Clickable button 3]]
wikitext
text/x-wiki
{{tracked|T39744}}
{{TemplateBox
|1=target
|1d=The target page of the "button". For external links, however, it is recommended using the named parameter target. Please use named parameters if it is an external link because they often contain <code><nowiki>=</nowiki></code> which would confuse the parser.
|1def=
|1stat=required
|1aliases=1
|3=text
|3d=Text (caption) the button should carry. Either you specify text or an icon.
|3def=
|3stat=required
|3aliases=2
|5=external
|5d=Is this an external link? If it is, set to yes or aye, or whatever you like, except nothing.
|5def=
|5stat=optional
|5aliases=3
|7=iconPrimary
|7d=A jquery UI icon class for the primary icon (in LTR languages on the left side of the button label/text). E.g. ''ui-icon-gear''[http://api.jqueryui.com/theming/icons/]
|7def=
|7stat=optional-
|7aliases=4
|9=iconSecondary
|9d=A jquery UI icon class for the secondary icon (in LTR languages on the right side of the button label/text). E.g. ''ui-icon-triangle-1-s''
|9def=
|9stat=optional-
|9aliases=5
|11=class
|11d=Add classes like <code> ui-button-green ui-button-large</code>
|11def=
|11stat=optional-
|13=id
|13d=Unique id to be used as the button's ID-Attribute. Useful for JavaScript-binding and CSS-styling.
|13def=
|13stat=optional-
|name=Clickable button
|desc=Provides a button with hover effects.
|namespace=all
|usergroup=all
|placement=
|usage-notes=
----
:<code><nowiki>{{Clickable button|FAQ|Frequently asked questions}}</nowiki></code> →
::: {{Clickable button|FAQ|Frequently asked questions}}
----
: <code><nowiki>{{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}</nowiki></code> →
::: {{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}
----
: <code><nowiki>{{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}</nowiki></code> →
::: {{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}
----
: <code><nowiki>{{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}</nowiki></code> →
::: {{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}
----
: <code><nowiki>{{Clickable button|target={{fullurl:Special:Random/User talk|action=edit§ion=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}</nowiki></code> →
::: {{Clickable button|target={{fullurl:Special:Random/User talk|action=edit§ion=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}
|type=formatting
|example=
|i18n-method=-
|i18n-desc=
|seealso=
* {{tl|button}} (works without JS enabled)
* {{tl|Clickable button 2}} (import from de.wikipedia)
* {{tl|key press}}
* {{tl|Clickable button 3}}
|setscats=
|lines=1
|shorthand=
|relieson=
* [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=tree;f=resources/jquery.ui jquery.ui.button]
}}
== Test suite/ Unit tests ==
<table>
<tr><td>Icon only</td><td>{{Clickable button|iconPrimary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info}}</td></tr>
<tr><td>Icon text</td><td>{{Clickable button|iconPrimary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info|text=Abc}}</td></tr>
<tr><td>Text only, links</td><td>{{Clickable button|text=Abc}}</td><td>{{Clickable button|text=Abc|target=Main Page}}</td><td>{{Clickable button|text=Abc|target=//commons.wikimedia.org/wiki/Main_Page|external=1}}</td></tr>
<tr><td>Colors</td><td>{{Clickable button|text=Abc|class=ui-button-green}}</td><td>{{Clickable button|text=Abc|class=ui-button-red}}</td><td>{{Clickable button|text=Abc|class=ui-button-blue}}</td></tr>
</table>
<includeonly>
<!-- Interwikis go on Wikidata, please add only Categories here -->
[[Category:Formatting templates]]
</includeonly>
4cc3aaa3f6a8c5082a0131dcc282df65b98730a7
Template:TemplateDataInfo/i18n/en
10
50
115
2021-06-23T17:10:28Z
mw>FuzzyBot
0
Updating to match new version of source page
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{TemplateDataInfo/layout
|title=TemplateData
|text=[[:mw:Special:MyLanguage/Extension:TemplateData|TemplateData]] is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by [[:mw:Special:MyLanguage/:VisualEditor|VisualEditor]] and possibly other tools like [[Special:MyLanguage/Commons:Upload Wizard|Upload Wizard]].
----
<u>Existing template documentation</u><br/>
At Wikimedia Commons, it is recommended to use {{tl|TemplateBox}} with either <code><nowiki>‎useTemplateData=1</nowiki></code> or <code><nowiki>‎useTemplateData=only</nowiki></code> on the <code><nowiki>‎/doc</nowiki></code> subpage and transcluding it with {{tl|Documentation}} into the template. {{tag|nowiki|o}}-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
<u>Newly created template documentation and imports</u><br/>
Another option, especially for imported templates, or for users with JSON experience, is placing raw {{tag|templatedata|o}}-tags into the Wikitext of the template, as described in various Wikipediae.
<u>Discussion</u><br/>
[[Commons:Requests for comment/How Commons should deal with TemplateData|There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.]]
|help=Wikipedia's help about TemplateData
|helppage=:en:Wikipedia:VisualEditor/TemplateData/Tutorial
|info=Commons-specific information
|lang={{#invoke:Caller title|lang|base=Template:TemplateDataInfo/i18n}}
}}</onlyinclude>
{{translated tag|header}}
a867573cd8ef62bdca5895c488ba206e3f221ac8
Template:Dir
10
34
83
2021-06-24T02:55:37Z
mw>Hedwig in Washington
0
Fulfilling [[Template:Edit request|edit request]] by [[User:Tofeiku|Tofeiku]]. Thanks for helping!
wikitext
text/x-wiki
{{#switch:{{{1}}}|aeb|aeb-arab|ar|arc|arq|ary|arz|azb|bcc|bgn|bqi|ckb|dv|fa|fa-af|glk|ha-arab|he|khw|kk-arab|kk-cn|ks|ks-arab|ku-arab|lki|lrc|luz|ms-arab|mzn|nqo|ota|pnb|prd|ps|sd|sdh|skr|skr-arab|ug|ug-arab|ur|uz-arab|ydd|yi={{{2|rtl}}}|{{{3|ltr}}}}}<noinclude>
{{Documentation}}
</noinclude>
df6edd972399033f616fa661a1879888642907cd
Template:Tag
10
45
105
2021-07-07T22:41:51Z
mw>ExE Boss
0
[[mw:Special:Diff/2345989/4634499|6 revisions]] imported from [[mw:Template:Tag]]
wikitext
text/x-wiki
{{#if:{{{plain|}}}|
|<code class="mw-highlight" style="{{#if:{{{wrap|}}}||white-space:nowrap}}">
}}{{#switch:{{{2|pair}}}
|c|close = <!--nothing-->
|s|single
|o|open
|p|pair = {{#tag:span|‎<|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#if:{{{params|}}}| {{{params}}}}}
}}{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|s|single =  {{#tag:span|/>|class="p"}}
|o|open = {{#tag:span|>|class="p"}}{{{content|}}}
|p|pair = {{#tag:span|>|class="p"}}{{{content|...}}}
}}{{#switch:{{{2|pair}}}
|s|single
|o|open = <!--nothing-->
|c|close
|p|pair = {{#tag:span|‎</|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#tag:span|>|class="p"}}
}}{{#if:{{{plain|}}}|
|</code>
}}<noinclude>
{{Documentation}}
</noinclude>
88657ad7afd7844d9681f7f08ba60c75c25800a1
Module:Hatnote/styles.css
828
153
355
2021-07-12T19:22:27Z
en>Izno
0
per my talk page
sanitized-css
text/css
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Template:TemplateBox/styles.css
10
49
113
2021-08-04T01:06:43Z
mw>1989
0
Fulfilling [[Template:Editprotected|edit request]] by ExE Boss
text
text/plain
.templatebox-desc {
font-size: 1.2em;
font-weight: bolder;
padding: 0.2em;
text-shadow: 1px 1px 1px rgb(255, 255, 255);
}
.templatebox-usagesample {
background: white;
background: rgba(255, 255, 255, 0.9);
font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono',
'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace;
}
.templatebox-languagedependant {
background: rgba(255, 255, 255, 0.5);
padding: 0.2em;
}
.templatebox-example {
border: 1px solid black;
background-color: white;
width: 90%;
padding: 1.5em;
}
.templatebox-example:after {
display: block;
content: "";
clear: both;
}
hr.templatebox-examples-separator {
margin: 1em 0;
}
8ed2a78f01e66c149aa24c906458f66c0da13a5c
Template:Tracked/styles.css
10
58
131
2021-08-06T06:25:46Z
mw>ExE Boss
0
Add styles for `.tracked .status` (match [[mw:Template:Tracked/styles.css]])
text
text/plain
/**
* Styles for [[Template:Tracked]].
*/
.tracked {
float: right;
clear: right;
border: 1px solid #999;
border-radius: 0.5em;
background-color: #eee;
background-image: linear-gradient(to bottom, #ddd,#eee);
font-size: 85%;
text-align: center;
padding: 0.5em;
margin-left: 1em;
margin-bottom: 1em;
width: 12em;
color: black;
}
.tracked p {
margin: 0;
}
.tracked-url {
font-weight: bold;
}
/* status line */
.tracked .status,
.tracked-status {
font-weight: bold;
text-transform: uppercase;
}
.tracked .status.resolved,
.tracked-resolved {
color: green;
}
.tracked .status.critical,
.tracked-critical {
color: red;
font-size: 1.5em;
}
380e3497ad1559974c1965d32a486b9f188bf47c
Template:Tracked/layout
10
57
129
2021-08-06T07:30:49Z
mw>ExE Boss
0
Use {{[[mw:Special:MyLanguage/Extension:Scribunto#.23invoke|#invoke]]:[[Module:TNT|TNT]]|msg|[[c:Data:I18n/Tracked.tab|I18n/Tracked.tab]]}}
wikitext
text/x-wiki
<onlyinclude><templatestyles src="Template:Tracked/styles.css"
/><div class="tracked plainlinks {{#if:{{{1|}}}|mw-trackedTemplate}}" {{#if:{{{float|}}}{{{style|}}}|style="<!--
-->{{#if:{{{float|}}}|float:{{{float}}};clear:{{{float}}};}}<!--
-->{{{style|}}}<!--
-->"}}><!--
-->{{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|header-phabricator}}<br/><!--
-->{{#if:{{{1|<noinclude>1</noinclude>}}}|'''[[phabricator:{{{1|}}}|<span class="tracked-url trakfab-{{{1}}}">{{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|task|{{{1}}}}}</span>]]'''<br/>}}<!--
--><span class="{{trim|1=status {{#switch:{{lc:{{{2|}}}}}
|resolved|fixed=resolved
}}}}">{{#switch:{{lc:{{{2|}}}}}
|open={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-open}}
|resolved|fixed={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-resolved}}
|duplicate={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-duplicate}}
|stalled|later={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-stalled}}
|declined|wontfix={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-declined}}
|invalid={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-invalid}}
}}</span></div></onlyinclude>
[[Category:Layout templates]]
2a2be2946d542a16fb6a4adfb4c04cf7eccd7860
Template:Tracked
10
56
127
2021-08-06T07:44:43Z
mw>ExE Boss
0
Use {{[[mw:Special:MyLanguage/Extension:Scribunto#.23invoke|#invoke]]:[[Module:TNT|TNT]]|msg|[[c:Data:I18n/Tracked.tab|I18n/Tracked.tab]]}} by using {{[[Template:Tracked/layout|Tracked/layout]]}}
wikitext
text/x-wiki
<onlyinclude>{{Tracked/layout
|1={{#if:{{{1|<noinclude>1</noinclude>}}}|
{{#ifeq:{{padleft:|1|{{uc:{{{1}}}}}}}|T
| {{uc:{{{1}}}}}<!-- Phab -->
| T{{#expr:{{{1|}}}+2000 }}<!-- Bugzilla -->
}}
}}
|2={{{2|}}}
|float={{{float|}}}
|style={{{style|}}}
}}</onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
77ceeeae108cc39044714f8d4245e1e1f476dc77
Template:Tmpl
10
55
125
2021-08-06T17:03:07Z
mw>CptViraj
0
Protected "[[Template:Tmpl]]": [[Commons:Protection policy|Widely used template]]: [[Special:PermaLink/578762431#Template:Tmpl and Module:Tmpl|Request at COM:ANB]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
wikitext
text/x-wiki
<onlyinclude><includeonly>{{#invoke:Tmpl|renderTmpl}}</includeonly></onlyinclude>
{{Documentation}}
d922467760bdc418abb5df1e8565ae09d322a8de
Module:Tmpl
828
69
153
2021-08-06T17:03:50Z
mw>CptViraj
0
Protected "[[Module:Tmpl]]": [[Commons:Protection policy|High-risk Lua module]]: [[Special:PermaLink/578762431#Template:Tmpl and Module:Tmpl|Request at COM:ANB]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
-- This is a helper module for Template:tmpl
local this = {}
function this.renderTmpl(frame)
local args = frame.args
local pargs = (frame:getParent() or {}).args
local result = pargs[0] or ''
for k, v in pairs(pargs) do
local n = tonumber(k) or -1
if (n >= 1 and n <= 9) then
result = mw.ustring.gsub( result, '$' .. n, mw.text.trim(v) )
end
end
return result
end
return this
7dcfd761abcd3c0d9977b26f961d5dc5052449e3
Template:Protected/text/en
10
42
99
2021-08-11T00:01:10Z
mw>FuzzyBot
0
Updating to match new version of source page
wikitext
text/x-wiki
<languages />
<onlyinclude>{{#switch:{{{1}}}
|text1=This {{namespace}} has been protected
|default-reason=from editing to prevent vandalism.
|reason=because {{{reason}}}.
|text2=Please discuss changes on the [[{{TALKPAGENAME}}|talk page]] or [[COM:AN/P|request unprotection]].
|img-text1=This page is protected against editing.
|img-text2=This page is semi-protected against editing.
|img-text3=This page is protected against reuploading.
|img-text4=This page is semi-protected against reuploading.
|img-text5=This page is template protected against editing.
|error-text=Error: This page is not currently protected. Please [[COM:AN/P|request protection]] or remove the protection template.
}}</onlyinclude>
{{translated tag|protection}}
57a0149cabd41c652f4b355a09433e45c076cf8c
Template:Template parameter usage
10
137
319
2021-08-21T18:02:56Z
en>SUM1
0
Added missing "lc" parameters; added optional "based" parameter to add text "based on this[/its] TemplateData" at end of template
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
b9cdd1b2e409313904f041c38562a3d6221cc017
Template:Conj-and
10
76
167
2021-08-25T22:29:01Z
mw>ExE Boss
0
Use {{[[Template:localized mw message|localized mw message]]}}
wikitext
text/x-wiki
<noinclude>''This shows a localized coordination between numbers:'' 1<span style="background:yellow"></noinclude><!--
-->{{LangSwitch
| lang = {{#if: {{{lang|}}}
| {{{lang|}}}
| {{#switch: {{NAMESPACE}} |File|Creator = {{int:Lang}} |#default= {{PAGELANGUAGE}} }}
}}
| default =  {{localized mw message|and|missing= and |lang = {{#if: {{{lang|}}}
| {{{lang|}}}
| {{#switch: {{NAMESPACE}} |File|Creator = {{int:Lang}} |#default= {{PAGELANGUAGE}} }}
}}
}} 
| bg =  и 
| bn =  ও 
| ca =  i 
| cs =  a 
| da =  og 
| de =  und 
| eo =  kaj 
| es =  y 
| fa =  و
| fr =  et 
| he =  ו
| hu =  és 
| id =  dan 
| it =  e 
| ja = および
| ko =  와 
| mk =  и 
| nl =  en 
| no =  og 
| pl =  i <!-- Polish has 2 alternative versions of "and" : "oraz" and "i". Translatewiki has "oraz" but "i" works better in most cases. -->
| pt =  e 
| ru =  и 
| sk =  a 
| sl =  in 
| sv =  och 
| th = และ
| uk =  і 
|zh|zh-my|zh-sg|zh-cn|zh-hans = 和
|zh-mo|zh-hk|zh-tw|zh-hant = 和
}}<noinclude><!--
--></span>2.
{{Documentation}}
</noinclude>
46f50e4bfc18690f18d534f6bcca4afde5c7ca4e
Template:Localized mw message
10
80
175
2021-08-27T04:38:29Z
mw>ExE Boss
0
Merge into {{[[Template:int|int]]}}
wikitext
text/x-wiki
#REDIRECT [[Template:Int]] {{Template redirect}}
ec2ef44b12b6d22453009b3bee9277dd944c0e67
Template:Int
10
78
171
2021-08-27T04:38:42Z
mw>ExE Boss
0
Merge from {{[[Template:localized mw message|localized mw message]]}} ([[d:Special:EntityPage/Q86596927|Q86596927]])
wikitext
text/x-wiki
<onlyinclude>{{<includeonly>safesubst:</includeonly>#invoke:Int|renderIntMessage|{{{1}}}|missing={{{missing|}}}|lang={{{lang|}}}}}</onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
7fcbf21aa479eefc0f0d45d3c4841770e0467388
Template:TemplateData header
10
132
309
2021-08-29T21:32:29Z
en>SUM1
0
Added "based" parameter to other transclusion
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Documentation subpage
10
39
93
2021-09-17T09:03:17Z
mw>ExE Boss
0
Fullfilling my [[c:Template talk:Documentation subpage#Use namespaced categories|edit request]]: Use namespaced categories ([[:Category:Template documentation]], [[:Category:Module documentation]], and [[:Category:User documentation]])
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{SUBPAGENAME}}|{{#ifeq:{{{1|}}}|override|{{SUBPAGENAME}}|doc}}|</includeonly><!-- show on doc pages only
-->{{#invoke:Autotranslate | autotranslate
|base = Documentation subpage
|lang = {{{lang|}}}
|page = {{#if:{{{page|}}}|{{{page|}}}|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}
}}<!--
--><includeonly>{{{category|[[Category:{{#switch:{{SUBJECTSPACE}}
| Template = Template
| Module = Module
| User = User
| #default = Template
}} documentation|{{PAGENAME}}]]__EXPECTED_UNCONNECTED_PAGE__}}}</includeonly><!--
--><includeonly>}}</includeonly><!-- show on doc pages only
--><noinclude>{{documentation}}</noinclude>
783c674f03e3009e9b9ddc1cfd632a593534f7c6
287
93
2021-12-24T18:56:04Z
en>GKFX
0
Use [[Template:Terminate sentence]], which correctly determines when to add a full stop.
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
'''This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]] for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}'''<br />It contains usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
3927805b1d0a3d539d4f7128187ffd8b196a209a
Template:Documentation
10
35
85
2021-09-18T17:21:44Z
mw>ExE Boss
0
Use {{[[mw:Special:MyLanguage/Extension:Scribunto#.23invoke|#invoke]]:[[Module:autotranslate|autotranslate]]|autotranslate|base=[[Template:Documentation/i18n]]}}
wikitext
text/x-wiki
<!-- {{#invoke:Autotranslate|autotranslate}} is used to avoid "Warning: This page calls Template:Autotranslate which causes a template loop (an infinite recursive call). "-->
<onlyinclude>{{#invoke:Autotranslate|autotranslate
| base = Template:Documentation/i18n
|lang = {{{lang|{{int:Lang}} }}}
|1 = {{#if:{{{1|}}}
|{{{1}}}
|{{#ifexist:{{SUBJECTPAGENAME}}/doc
|{{SUBJECTPAGENAME}}/doc
|{{#ifexist:{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{SUBJECTPAGENAME}}/doc
}}
}}
}}
|2 = {{{heading|{{{2|}}} }}}
|content = {{{content|}}}
}}</onlyinclude>
7ad33c9fa0ba8f527d5f6f881ab8ab02837d7e17
Module:Int
828
85
185
2021-09-18T19:42:37Z
mw>Tacsipacsi
0
use internal page language instead of an expensive module; no pages using legacy manual translation use this module anyway
Scribunto
text/plain
-- This is a helper module for [[Template:int]]
local this = {}
function this.renderIntMessage(frame)
local args = frame.args
local pargs = (frame:getParent() or {}).args
local arguments = {}
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if (n >= 2) then
arguments[n - 1] = mw.text.trim(v)
end
end
local msg = mw.message.new(mw.text.trim(args[1]), arguments)
local lang
if args.lang and args.lang ~= '' and mw.language.isValidCode(args.lang) then
lang = args.lang
else
lang = mw.getCurrentFrame():preprocess('{{PAGELANGUAGE}}')
end
if (msg:exists() and not msg:isDisabled()) or lang == 'qqx' then
local msgstr = msg:inLanguage(lang):plain()
return frame:preprocess(msgstr)
else
return args.missing ~= ''
and args.missing
or '⧼' .. args[1] .. '⧽'
end
end
return this
df08b6e37cb71c2e424e1b878fb84c4c2a9c1d5b
Template:TemplateDataInfo/styles.css
10
52
119
2021-09-19T11:08:10Z
mw>ExE Boss
0
Remove dependency on jQuery.UI styles (see [[phab:T100270|T100270]])
text
text/plain
.commons-template-TemplateDataInfo {
background:
/* color: */ #FFEF8F
/* image: */ linear-gradient(to bottom, #FFF1A0 35%, #FFEF8F 58%)
/* repeat: */ repeat-x
/* position/size: */ top/1px 100px
;
border: 1px solid #f9dd34;
color: #363636;
padding: 0 .5em;
margin: .5em 0;
}
.commons-template-TemplateDataInfo .header {
font-size: 120%;
font-family: monospace, monospace;
}
.commons-template-TemplateDataInfo[dir="ltr"] .header {
/* @noflip */
float: right;
}
.commons-template-TemplateDataInfo[dir="rtl"] .header {
/* @noflip */
float: left;
}
b9968af3a612eebf95bc89613dc43b01dc442978
Template:TemplateDataInfo/layout
10
51
117
2021-09-19T11:08:16Z
mw>ExE Boss
0
Remove dependency on jQuery.UI styles (see [[phab:T100270|T100270]])
wikitext
text/x-wiki
<onlyinclude><templatestyles src="Template:TemplateDataInfo/styles.css" /><div class="commons-template-TemplateDataInfo mw-content-{{dir|{{{lang|}}}}}" lang="{{BCP47|{{{lang|}}}}}" dir="{{dir|{{{lang|}}}}}">
<div class="header" lang="zxx" dir="ltr"><nowiki><templatedata>JSON</templatedata></nowiki> ./. {{tl|TemplateBox}}</div>
;{{{title}}}
{{{text}}}
----
[[{{{helppage|:en:Wikipedia:VisualEditor/TemplateData/Tutorial}}}|{{{help}}}]] • [[Special:MyLanguage/Commons:TemplateData|{{{info}}}]]
</div><includeonly>{{#ifeq:{{NAMESPACE}}:{{ROOTPAGENAME}}|Template:TemplateDataInfo|
|{{#switch:{{SUBPAGENAME}}
|#default=[[Category:Templates using TemplateData]]
|doc
|documentation
|metatemplatedoc
|templatedoc
= [[Category:TemplateData documentation]]
|sandbox=
|TemplateData={{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}
|[[Category:Templates using TemplateData]]
|[[Category:TemplateData documentation]]
}}
}}
}}</includeonly></onlyinclude>
[[Category:Layout templates]]
6945d2ce7eb7a3075e63cf2c64e09a7a9a4cd826
Template:Documentation/layout
10
37
89
2021-10-04T11:56:10Z
mw>ExE Boss
0
Use [[Module:TNTFallback]]
wikitext
text/x-wiki
<div id="template-documentation" class="template-documentation"><templatestyles src="Template:Documentation/styles.css" /><!--
-->{{#if: {{PROTECTIONLEVEL:edit}} | {{Protected}} }}<!--
-->{{#ifeq: {{{heading|}}} | false |
| <div class="template-documentation-heading mw-content-{{dir|{{{lang|}}}}}" lang="{{{lang|}}}" dir="{{dir|{{{lang|}}}}}"><!--
--><span class="template-documentation-title">{{#if: {{{heading|}}}
| {{{heading|}}}
| [[File:Test Template Info-Icon.svg|50px|link=|alt=]] {{#switch:{{NAMESPACENUMBER}}
| 6 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|file-namespace-heading|fallback={{{documentation|}}}}}
| 10 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|template-namespace-heading|fallback={{{documentation|}}}}}
| 828 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|module-namespace-heading|fallback={{{documentation|}}}}}
| #default = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|other-namespaces-heading|fallback={{{documentation|}}}}}
}}
}}</span><span class="mw-editsection-like plainlinks" id="doc_editlinks"><!--
-->[ {{#if:{{{content|}}}||{{#ifexist:{{transclude|{{{1|{{DocPageName}}}}}}}|<!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|view-link-display|fallback={{{view|}}}}}] '''·''' <!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=edit}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|edit-link-display|fallback={{{edit|}}}}}] '''·''' <!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=history}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|history-link-display|fallback={{{history|}}}}}] '''·''' <!--
--><nowiki/>|<!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=edit&preload=Template:Documentation/preload}} {{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|create-link-display}}] '''·''' <!--
--><nowiki/>}}}}<!--
-->[{{fullurl:{{FULLPAGENAME}}|action=purge}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|purge-link-display|fallback={{{purge|}}}}}]<!--
--> ]</span></div>
}}
{{#if: {{{content|}}}
| <!-- do not show notice when /doc is not transcluded-->
<div class="template-documentation-content" lang="" dir="auto">
{{{content|}}}
</div>
| <div class="template-documentation-transcludedfrom mw-content-{{dir|{{{lang|}}}}}" lang="{{{lang|}}}" dir="{{dir|{{{lang|}}}}}">{{tmpl<!--
-->|0={{{text|(text: $1) — {{error|parameter text is not translated in [[Template:Documentation]]}}}}}<!--
-->|1=[[{{transclude|{{{1|{{DocPageName}}}}}}}]]<!--
-->}}</div>
<div class="template-documentation-content" lang="" dir="auto">
{{ {{{1|{{DocPageName}}}}} }}
</div>
}}
</div><noinclude>
{{#ifeq: {{SUBPAGENAME}} | sandbox | [[Category:Sandbox templates]] }}
[[Category:Layout templates]]
</noinclude>
d4416a7946916c152eaba1f50d7dbe50e60cfd1b
Template:Documentation/i18n/en
10
36
87
2021-10-04T12:10:56Z
mw>ExE Boss
0
Updating to match new version of source page: Use <[[mw:Special:MyLanguage/Help:Transclusion#<onlyinclude>|onlyinclude]]> and {{[[Template:tmpl|tmpl]]}}
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{Documentation/layout
| lang = {{{lang|{{#invoke:Caller title|lang|base=Template:Documentation/i18n}}}}}
<!-- {{Documentation}} parameters: -->
|1={{{1|}}}
|heading={{{heading|{{{2|}}}}}}
|content={{{content|}}}
<!-- $1 is automatically replaced by [[Template:Documentation/layout]] using {{tmpl}} -->
| text = This documentation is [[w:Wikipedia:Transclusion|transcluded]] from $1.
<!-- DEPRECATED - New translations for these messages go in [[Data:I18n/Documentation.tab]]: -->
|edit=edit
|history=history
|view=view
|documentation=Documentation
}}</onlyinclude>
{{translated tag|documentation}}
359e436ac422fc11735fb22bcc4b900b77fd5423
Template:TemplateBox/layout
10
48
111
2021-10-05T10:34:02Z
mw>ExE Boss
0
Add support for `i18n‑method=[[Module:TNT|TNT]]` ([[:Category:Templates using Module:TNT for internationalisation]])
wikitext
text/x-wiki
<templatestyles src="TemplateBox/styles.css" />
__NOEDITSECTION__
{{#ifeq:{{{useTemplateData|}}}|export
|== {{{msg-export|Export code}}} ==
{{#tag:pre|{{msgnw:Template:{{{name|}}}}}
<nowiki><noinclude><templatedata></nowiki>
{{{JSONFM}}}
<nowiki></templatedata>
</noinclude></nowiki>
}}
|{{Documentation subpage|{{#if: {{{docsub-override|}}} | override | }}|page={{{docsub-page|}}}}}
{{#if: {{{desc|}}} | {{{msg-languagedependant|}}}
<div class="templatebox-desc">
{{{desc}}}
</div> | {{{msg-nodesc|}}} }}{{#if: {{{setscats|}}} |<nowiki/>
{{{msg-setscats}}}
{{{setscats|}}}
}}
== {{{msg-usage|}}} ==
{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|-1}}|doc||{{#if:{{{mustbesubst|}}}|{{Must be substituted|page={{{name|}}}}}}}}}
<div class="templatebox-usagesample">
{{{usageSample|}}}
</div>{{#if: {{{shorthand|}}} |<nowiki/>
{{{msg-shorthand|}}}<kbd>{{#ifexist: Template:{{{shorthand|}}} | <nowiki>{{</nowiki>{{{shorthand}}}{{#ifeq:{{{argCount|}}}|0|<!-- nothing -->| {{!}}{{{msg-shorthand-params-possible|… parameters as described …}}}}}<nowiki>}}</nowiki> | {{{shorthand|}}}}}</kbd>
}}{{#if: {{{usage-notes|}}} |<nowiki/>
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{usage-notes}}}
</div>
}}{{#if: {{{paramTable|}}} |<nowiki/>
=== {{int:templatedata-doc-params}} ===
{{#ifeq:{{{useTemplateData|}}}|only||{{{paramTable}}}}}
|<nowiki/>
{{{msg-param-none|}}} }}
{{#if:{{{useTemplateData|}}}
|{{#ifeq:{{{useTemplateData|}}}|only||{{Collapse top|[[:mw:Special:MyLanguage/Extension:TemplateData|{{{msg-templatedata|Template data}}}]]}}}}
{{{templateDataInfo}}}
{{#tag: templatedata
| {{{templateData|}}}
}}
{{#ifeq:{{{useTemplateData|}}}|only||{{Collapse bottom}}}}
}}
=== {{{msg-moreinfo|}}} ===
{{{msg-intendednamespaces|}}}
{{#switch: {{{namespace|}}}
|={{{msg-intendednamespaces-default|}}}
|all={{{msg-intendednamespaces-all|}}}
|talks={{{msg-intendednamespaces-talks|}}}
|contents={{{msg-intendednamespaces-contents|}}}
|0|Main|Gallery|main|gallery={{{msg-intendednamespaces-0|}}}
|1|Talk|talk={{{msg-intendednamespaces-1|}}}
|2|User|user={{{msg-intendednamespaces-2|}}}
|3|User talk|user talk={{{msg-intendednamespaces-3|}}}
|4|Commons|commons={{{msg-intendednamespaces-4|}}}
|5|Commons talk|commons talk={{{msg-intendednamespaces-5|}}}
|6|File|file={{{msg-intendednamespaces-6|}}}
|7|File talk|file talk={{{msg-intendednamespaces-7|}}}
|8|MediaWiki|mediaWiki={{{msg-intendednamespaces-8|}}}
|9|MediaWiki talk|mediaWiki talk={{{msg-intendednamespaces-9|}}}
|10|Template|template={{{msg-intendednamespaces-10|}}}
|11|Template talk|template talk={{{msg-intendednamespaces-11|}}}
|12|Help|help={{{msg-intendednamespaces-12|}}}
|13|Help talk|help talk={{{msg-intendednamespaces-13|}}}
|14|Category|category={{{msg-intendednamespaces-14|}}}
|15|Category talk|category talk={{{msg-intendednamespaces-15|}}}
|16|Creator|creator={{{msg-intendednamespaces-16|}}}
|17|Creator talk|creator talk={{{msg-intendednamespaces-17|}}}
|18|Special|special={{{msg-intendednamespaces-18|}}}
|#default={{{msg-intendednamespaces-unknown|}}}
}}
{{{msg-intendedusergroups|}}}<!-- usergroup is always lower case transformation on [[Template:TemplateBox]] -->
{{#switch: {{{usergroup|}}}
|all={{{msg-intendedusergroups-all|}}}
|bot={{{msg-intendedusergroups-bot|}}}
|administrator|admin|sysop={{{msg-intendedusergroups-admin|}}}
|bureaucrat|crat={{{msg-intendedusergroups-bureaucrat|}}}
|checkuser={{{msg-intendedusergroups-checkuser|}}}
|licensereviewer|imagereviewer|image-reviewer|license-reviewer={{{msg-intendedusergroups-imagereviewer|}}}
|vrt|vrt-agent|otrs|otrs-agent|otrs-member={{{msg-intendedusergroups-vrt|}}}
|autoconfirmed={{{msg-intendedusergroups-autoconfirmed|}}}
|autopatrolled={{{msg-intendedusergroups-autopatrolled|}}}
|filemover={{{msg-intendedusergroups-filemover|}}}
|oversight={{{msg-intendedusergroups-oversight|}}}
|patroller={{{msg-intendedusergroups-patroller|}}}
|rollbacker={{{msg-intendedusergroups-rollbacker|}}}
|steward={{{msg-intendedusergroups-steward|}}}
|templateeditor|template editor={{{msg-intendedusergroups-templateeditor|}}}
|upwizcampeditors={{{msg-intendedusergroups-upwizcampeditors|}}}
|translationadmin|translateadmin={{{msg-intendedusergroups-translationadmin|}}}
|#default={{{msg-intendedusergroups-unspecified|}}}
}}{{#if: {{{placement|}}} |<nowiki/>
{{{msg-placement|}}}
{{#switch: {{{placement|}}}
|top={{{msg-placement-top|}}}
|bottom={{{msg-placement-bottom|}}}
|license|licence={{{msg-placement-licence|}}}
|source={{{msg-placement-source|}}}
|#default={{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{placement}}}
</div>
}}
}}{{#if: {{{relieson|}}} |<nowiki/>
{{{msg-relieson|}}}<br />
{{{relieson|}}}
}}{{#if: {{{example|}}}{{{example2|}}} |<nowiki/>
== {{{msg-examples}}} ==
<nowiki/>}}{{#if: {{{example|}}} |<nowiki/>
<nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example}}}<nowiki>}}</nowiki>
{{{msg-example-renders-as|}}}
<div class="templatebox-example">
{{#if:{{{example-value|}}}|{{{example-value}}}|{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example|}}}|category=}}}}
</div>
}}{{#if: {{{example2|}}} |<nowiki/>
{{#if: {{{example|}}}
|<hr class="templatebox-examples-separator"/>}}
<nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example2}}}<nowiki>}}</nowiki>
{{{msg-example-renders-as|}}}
<div class="templatebox-example">
{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example2|}}}|category=}}
</div>
}}{{#if: {{{seealso|}}} |<nowiki/>
== {{{msg-seealso|}}} ==
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{seealso}}}
</div>
}}{{#switch: {{{i18n-method|}}}
|-=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-none|}}}
|autotranslate=<nowiki/>
== {{{msg-localization|}}} ==
{{lang links|Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|suppressaddlink=true}}
{{{msg-localization-instruct-autotranslate}}}
{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
{{tmpl|0=
{{{msg-localization-template-layout}}}
|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
}}
}}
{{{msg-localization-instruct-autotranslate-new}}}
{{#tag:inputbox|
type=create
preload=Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}/en
default=Template:{{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}} }}/{{#ifexist: Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}/{{int:Lang}} | LANGCODE | {{int:Lang}} }}
}}
|ext.translate=<nowiki/>
== {{{msg-localization|}}} ==
{{lang links|suppressaddlink=true|1={{{i18n-subpage}}}}}
{{{msg-localization-ext-translate}}}
{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
{{tmpl|0=
{{{msg-localization-template-layout}}}
|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
}}
}}
<div style="text-align:center">{{Clickable button|target={{TranslateLink|{{{i18n-subpage}}}}}|text=[[File:Icono de traducción.svg|48px|link=]]'''{{{msg-localization-instruct-ext-translate}}}'''|class=ui-button-blue ui-button-large|external=true}}</div>
<div style="text-align:center">{{Clickable button|target={{fullurl:{{{i18n-subpage}}}|action=edit}}|text='''{{{msg-localization-instruct-ext-translate-admin}}}'''|class=ui-button-red ui-button-large|iconPrimary=ui-icon-wrench|external=true}}</div>
|switch=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-switch|}}}
|mediawiki-msg=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-mediawiki-msg|}}}
|custommediawiki-msg=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-custommediawiki-msg|}}}
|TNT=<nowiki/>
<h2>{{{msg-localization}}}</h2>
{{{msg-localization-tnt}}}
{{tmpl|0=
{{{msg-localization-instruct-tnt}}}
|1=[[Data:{{#if:{{{i18n-data-file|}}}<!--
-->|{{#invoke:TNTTools|TNTTabFull|{{{i18n-data-file}}}}}<!--
-->|I18n/{{#if:{{{name|}}}|{{{name}}}|{{ROOTPAGENAME}}}}.tab<!--
-->}}]]
}}
|#default=
}}{{#if: {{{i18n-desc|}}} |<nowiki/>
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{i18n-desc}}}
</div>
}}}}<noinclude>[[Category:Layout templates]]</noinclude>
ba24e9161173d0bcbff656777a54bd39d9f18046
Template:TemplateBox
10
46
107
2021-10-05T10:35:54Z
mw>ExE Boss
0
Add support for `i18n‑method=[[Module:TNT|TNT]]` ([[:Category:Templates using Module:TNT for internationalisation]])
wikitext
text/x-wiki
<includeonly>{{#invoke:Languages|autolang|base=TemplateBox/i18n
|useargs=both
|templateData={{#invoke:TemplateBox|templatedata}}
|JSONFM={{#invoke:TemplateBox|templatedata|formatting=pretty}}
|paramTable={{#invoke:TemplateBox|paramtable}}
|usageSample={{#invoke:TemplateBox|usagesample}}
|argCount={{#invoke:TemplateBox|argcount}}
|desc={{#invoke:TemplateBox|description}}
|templateDataInfo={{TemplateDataInfo/toggler}}
|i18n-subpage={{#ifeq:{{{i18n-subpage|}}}|.
| Template:{{{name|{{BASEPAGENAME}}}}}
| Template:{{{name|{{BASEPAGENAME}}}}}/{{{i18n-subpage|i18n}}}
}}
|usergroup={{lc:{{{usergroup|}}}}}
|name={{{name|{{BASEPAGENAME}}}}}
}}__NOEDITSECTION__<!--
Auto-categorization by internationalisation approach
-->{{#ifeq:{{SUBPAGENAME}}|doc
| <!--Don't categorize documentation subpages-->
| {{#ifeq:{{NAMESPACE}}|Template
| {{#switch:{{{i18n-method|}}}
|autotranslate=[[Category:Templates using Autotranslate for internationalisation]]
|switch=[[Category:Templates using LangSwitch for internationalisation]]
|custommediawiki-msg=[[Category:Templates using local MediaWiki messages for internationalisation]]
|mediawiki-msg=[[Category:Templates using MediaWiki messages from translatewiki.net for internationalisation]]
|ext.translate=[[Category:Templates using the Translate extension for internationalisation]]
|TNT =[[Category:Templates using Module:TNT for internationalisation]]
|-=[[Category:Templates not requiring internationalization]]
|#default=[[Category:Templates using an unknown approach for internationalisation]]
}}
| <!--Don't categorise Creator templates-->
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
bb241ecce14f3e8112e01930bffb5533bf57a9ec
Module:TNTFallback
828
66
147
2021-10-08T23:19:06Z
mw>Mdaniels5757
0
Protected "[[Module:TNTFallback]]": [[Commons:Protection policy|High-risk Lua module]] ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
Scribunto
text/plain
--------------------------------------------------------------------------------
-- This module implements a wrapper for [[Module:TNT]] that allows returning
-- a fallback message; used by {{Documentation}}.
--
-- @module TNTFallback
-- @alias p
-- @author [[User:ExE Boss]]
-- @require [[Module:No globals]]
-- @require [[Module:TNT]]
--------------------------------------------------------------------------------
require("Module:No globals");
local TNT = require("Module:TNT");
local p = {};
--------------------------------------------------------------------------------
-- Based on [[Module:TNT]]'s `msg` function,
-- but takes an optional `fallback` parameter.
--------------------------------------------------------------------------------
function p.msg(frame)
local dataset, key;
local params = { n = 0 };
local lang = nil;
local fallback = nil;
for k, v in pairs(frame.args) do
if (k == 1) then
dataset = v;
elseif (k == 2) then
key = v;
elseif (type(k) == "number" and k > 2) then
local i = k - 2;
params[i] = v;
params.n = math.max(params.n, i);
elseif ((k == "lang") and (v ~= "_")) then
lang = v;
elseif ((k == "fallback") and (v ~= "")) then
fallback = v;
end
end
local result;
if (lang) then
result = TNT.formatInLanguage(lang, dataset, key, unpack(params, 1, params.n));
else
result = TNT.format(dataset, key, unpack(params, 1, params.n));
end
if (fallback and (
-- not translated
(result and result == TNT.formatInLanguage("en", dataset, key, unpack(params, 1, params.n)))
-- no message
or (not result)
)) then
if (not lang) then
if (frame:callParserFunction("int:lang") ~= "en") then
return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
end
elseif (lang ~= "en") then
return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
end
end
return result;
end
return p;
62207ae74661fcf554ea78320f07e5c0d63b41c0
Template:BCP47
10
31
77
2021-10-09T10:00:07Z
mw>Tacsipacsi
0
copy a much longer list from [[m:Special:PermanentLink/21925090|Meta]]
wikitext
text/x-wiki
{{#switch:{{lc:{{{1|}}}}}
<!-- pseudo codes -->
||root|default|i-default=<!-- empty language tag means unknown per the HTML spec --><!-- or ={{int:lang}}? (the best user default), or =en? (the default "ContentLanguage" for unlocalized data on Meta) -->
<!-- current BCP47 violations by Wikimedia sites, which can be fixed using standard tags when they exist -->
|als=gsw
|bat-smg=sgs
|de-formal=de<!-- could be "de-x-formal", but actually a subset within standard "de" for HTML/XML -->
|eml=egl<!-- retired code, the de facto eml.wikipedia uses Emilian, not Romagnol -->
|fiu-vro=vro
|mo=ro-cyrl<!-- retired, best fit on Wikimedia sites, but no longer working in interwikis (Wikipedia project deleted) -->
|nl-informal=nl<!-- could be "nl-x-informal", but actually a subset within standard "nl" for HTML/XML -->
|nrm=nrf<!-- Wikimedia sites uses "nrm" to mean Norman, but standard "nrm" is an unrelated language. The "nrf" code is now standardized for Norman (previously used a private-use extension of French "fr-x-nrm") -->
|roa-rup=rup
|simple=en<!-- could be "en-simple" but actually a subset within standard "en" for HTML -->
|sr-ec=sr-cyrl
|sr-el=sr-latn
|zh-classical=lzh
<!-- other current BCP47 violations by Wikimedia sites, fixed using private-use extensions (if they are needed, labels are limited to 8 letters/digits) -->
|cbk-zam=cbk-x-zam
|map-bms=jv-x-bms
|roa-tara=it-x-tara
|tokipona|tp=x-tokipona
<!-- conforming BCP47 "private-use" extensions used by Wikimedia, which are no longer needed, and improved using now standard codes -->
|be-x-old=be-tarask
<!-- conforming but ambiguous BCP47 codes used by Wikimedia in a more restrictive way, with more precision -->
|arc=syc<!-- The de-facto arc.wikipedia.org, as per their community request, is in actual using Syriac which is coded as syc -->
|no=nb<!-- "no" means Bokmål on Wikimedia sites, "nb" is not used -->
|bh=bho<!-- "bh"="bih" is a language family, interpreted in Wikimedia as the single language "bho", even if its interwiki code remains bh) -->
|tgl=tl-tglg<!-- "tgl" on Wikimedia is the historic variant of the Tagalog macrolanguage ("tl" or "tgl", "tl" recommended for BCP47), written in the Baybayin script ("tglg") -->
<!-- conforming BCP47 "inherited" tags, strongly discouraged and replaced by their recommended tags (complete list that should not be augmented now) -->
|art-lojban=jbo<!-- still used in some old Wikimedia templates -->
|en-gb-oed=en-gb<!-- no preferred replacement, could be "en-gb-x-oed" but actually a subset within standard "en-gb" -->
|i-ami=ami
|i-bnn=bnn
|i-hak=hak
|i-klingon=tlh
|i-lux=lb
|i-navajo=nv
|i-pwn=pwn
|i-tao=tao
|i-tay=tay
|i-tsu=tstu
|no-bok=nb<!-- still used in some old Wikimedia templates -->
|no-nyn=nn<!-- still used in some old Wikimedia templates -->
|sgn-be-fr=sfb
|sgn-be-nl=vgt
|sgn-ch-de=sgg
|zh-guoyu=cmn<!-- this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-hakka=hak
|zh-min=zh-tw<!-- no preferred replacement, could be "zh-x-min", but actually a subset within standard "zh-tw"; not necessarily "nan" -->
|zh-min-nan=nan<!-- used in some old Wikimedia templates and in interwikis -->
|zh-xiang=hsn
<!-- conforming BCP47 "redundant" tags, discouraged and replaced by their recommended tags (complete list that should not be augmented now) -->
|sgn-br=bzs
|sgn-co=csn
|sgn-de=gsg
|sgn-dk=dsl
|sgn-es=ssp
|sgn-fr=fsl<!-- still used in some old Wikimedia templates -->
|sgn-gb=bfi
|sgn-gr=gss
|sgn-ie=isg
|sgn-it=ise
|sgn-jp=jsl
|sgn-mx=mfs
|sgn-ni=ncs
|sgn-nl=dse
|sgn-no=nsl
|sgn-pt=psr
|sgn-se=swl
|sgn-us=ase<!-- still used in some old Wikimedia templates -->
|sgn-za=sfs
|zh-cmn=cmn<!-- still used in some old Wikimedia templates, this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-cmn-Hans=cmn-hans<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hans" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-cmn-Hant=cmn-hant<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hant" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-gan=gan<!-- still used in some old Wikimedia templates -->
|zh-wuu=wuu<!-- still used in some old Wikimedia templates -->
|zh-yue=yue<!-- still used in some old Wikimedia templates and in interwikis -->
<!-- other "inherited" tags of the standard, strongly discouraged as they are deleted, but with no defined replacement there are left unaffected (complete list that should not be augmented now)-->
|cel-gaulish=xtg<!--ambiguous, most often "xtg" for Transalpine Gaulish in today's France, may also be "xcg" for Cisalpine Gaulish in today's Northern Italy-->
|i-enochian=x-enochian?
|i-mingo=x-mingo?
<!-- other standard "redundant" tags, which were unnecessarily registered (they validate with standard subtags) and that are left unaffected (complete list that should not be augmented now)
|az-arab
|az-cyrl
|az-latn
|be-latn
|bs-cyrl
|bs-latn
|de-1901
|de-1996
|de-at-1901
|de-at-1996
|de-ch-1901
|de-ch-1996
|de-de-1901
|de-de-1996
|en-boont
|en-scouse
|iu-cans
|iu-latn
|mn-cyrl
|mn-mong
|sl-nedis
|sl-rozaj
|sr-cyrl
|sr-latn
|tg-arab
|tg-cyrl
|uz-cyrl
|uz-latn
|yi-latn
|zh-hans
|zh-hans-cn
|zh-hans-hk
|zh-hans-mo
|zh-hans-sg
|zh-hans-tw
|zh-hant
|zh-hant-cn
|zh-hant-hk
|zh-hant-mo
|zh-hant-sg
|zh-hant-tw
--- standard special codes
|mul
|und
--- all other unaffected tags:
Minimal check of validity (valid BCP47 codes are necessarily stable over URLENCODE and #titleparts).
The check ensures that the code contains only ASCII letters, digits or hyphens, and starts by a letter.
This check is necessary to avoid a severe bug in MediaWiki, with some values of parameter 1, notably with
urlencoded characters (including quotes, braces, ampersands...), slashes, or any HTML or wiki formatting
(see also [[Template:CURRENTCONTENTLANGUAGE]]). If successful, force result to lowercase; otherwise
return an empty language tag.
-->
|#default =
{{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}}
| {{#ifeq: {{lc:{{#titleparts:{{{1|}}}|1}}}} | {{ucfirst:{{lc:{{#titleparts:{{{1|}}}|1}}}}}}
|
| {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}}
| {{lc:{{{1|}}}}}
}}
}}
}}
}}<noinclude>{{Documentation}}</noinclude>
c8d624bc6118b4a7d84d16636cf616ce4c2df56f
Help:Infobox/user style
12
142
331
2021-10-11T22:29:09Z
en>Izno
0
adjust in preparation for infoboxes going to TemplateStyles
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
</noinclude>
6da0d499b1fda33a6ba13b40e6605692fc3bb489
Template:High-use
10
123
289
2021-10-22T01:54:41Z
en>MusikBot II
0
Changed protection settings for "[[Template:High-use]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 3343 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|all-pages={{{all-pages|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
dc5ea36aa88cf409e3280bf65dbfc2566faffe29
Module:High-use
828
155
359
2021-11-01T21:11:55Z
en>GKFX
0
Link to https://linkcount.toolforge.org/ which is more detailed and mobile-friendly
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and (",''' and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
f7d07eb75abeaf93ce3dcb9515d8ac175bbfeb48
Module:Infobox
828
156
361
2021-11-16T10:29:48Z
en>Fayenatic london
0
spacing
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles, -- see function description
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
05a758c4532f643205b2300a5935f5d4ef3fc721
Module:Check for unknown parameters
828
143
335
2021-11-18T20:27:09Z
en>MSGJ
0
update to allow check for unnamed parameters, code by [[User:Frietjes]]
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Template:Main other
10
81
295
177
2021-12-10T16:08:06Z
en>Xaosflux
0
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Module:Documentation
828
145
339
2021-12-21T19:35:41Z
en>Izno
0
remove test deleted a decade ago
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink, purgeLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
75db229661bf7a537917c514074614e59a70fd0a
Module:Documentation/config
828
146
341
2021-12-21T19:36:23Z
en>Izno
0
remove test deleted a decade ago
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
a7cdf1cda3185137d4cb51b2839cd5e5c9b91d18
Module:Hatnote list
828
154
357
2021-12-26T20:05:24Z
en>Nihiltres
0
Undid revision 1062166786 by [[Special:Contributions/Matthiaspaul|Matthiaspaul]] ([[User talk:Matthiaspaul|talk]]); should be fixed now, and if not, please ping me with examples as I couldn't reproduce the original error
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
Template:TemplateBox/i18n/en
10
47
109
2022-01-02T23:07:46Z
mw>FuzzyBot
0
Updating to match new version of source page
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{TemplateBox/layout
|name={{{name|}}}|desc={{{desc|}}}|namespace={{{namespace|}}}|usergroup={{{usergroup|}}}|placement={{{placement|}}}|usage-notes={{{usage-notes|}}}|type={{{type|}}}|example={{{example|}}}|example2={{{example2|}}}|example-value={{{example-value|}}}|i18n-method={{{i18n-method|}}}|i18n-subpage={{{i18n-subpage|}}}|i18n-desc={{{i18n-desc|}}}|seealso={{{seealso|}}}|setscats={{{setscats|}}}|lines={{{lines|}}}|shorthand={{{shorthand|}}}|relieson={{{relieson|}}}|docsub-override={{{docsub-override|}}}|docsub-page={{{docsub-page|}}}|mustbesubst={{{mustbesubst|}}}|templateData={{{templateData|}}}|JSONFM={{{JSONFM|}}}|useTemplateData={{{useTemplateData|}}}|paramTable={{{paramTable|}}}|templateDataInfo={{{templateDataInfo|}}}|usageSample={{{usageSample|}}}|argCount={{{argCount|}}}
|msg-setscats=The template automatically sets the following categories:
|msg-nodesc=No description yet available.
|msg-languagedependant=<nowiki /><small><!-- Remove this comment and insert the translation of "This part of the documentation is only available in a limited number of languages." --></small>
|msg-usage=Usage
|msg-examples={{PLURAL:{{#expr:{{#if:{{{example|}}}|1|0}}+{{#if:{{{example2|}}}|1|0}}}}|Example|Examples}}
|msg-example-renders-as=renders as:
|msg-shorthand=Or use the shorthand <nowiki /><!--
Some translations removed from translation (T8-T18)
If you want to re-install them (because there is something wrong with the MediaWiki-messages
that are used and provided by TemplateData, here they are:
https://commons.wikimedia.org/w/index.php?title=Template:TemplateBox/i18n&oldid=102987719
-->
|msg-shorthand-params-possible=… parameters as described …
|msg-param-none=The template takes no parameters.
|msg-moreinfo=Additional information
|msg-localization=Localization
|msg-localization-instruct-switch=To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{Tlf|LangSwitch| }}" construct. It takes the form "<code>{{!}}xx= Your translation </code>" (<code>xx</code> being the {{W|List of ISO 639-1 codes|code}} of your language)
|msg-localization-instruct-autotranslate=This template is localized through {{tl|Autotranslate}}.
<!-- $1 is automatically replaced by [[Template:TemplateBox/layout]] using {{tmpl}} -->
|msg-localization-template-layout=The layout of the template can be found under $1.
|msg-localization-instruct-autotranslate-new=To add your language to the list of languages supported by this template, please copy the code of [[Template:{{{name|{{PAGENAME}}}}}/en]] (or any other language version you prefer to translate) and replace the text strings in there (the form below can be used to create a translation, the English version is preloaded in the edit box). Please change the parameter <code>lang</code> from <code>en</code> (or whatever language you are translating) to the [[:en:ISO 639-1|language code]] of your language.
|msg-localization-instruct-none=This template is not intended to be localized.
|msg-localization-instruct-custommediawiki-msg=This template is localized by utilizing custom MediaWiki namespace messages.
|msg-localization-instruct-mediawiki-msg=This template is localized by utilizing MediaWiki namespace messages. These can be [[translatewiki:{{#if:{{{i18n-mediawiki-msg|}}}|MediaWiki:{{{i18n-mediawiki-msg|}}}|Special:Translate/ext-wikimediamessages}}|translated at translatewiki.net]] ([[:translatewiki:Special:Translations/MediaWiki:{{#if:{{{i18n-mediawiki-msg|}}}|{{{i18n-mediawiki-msg|}}}|Wm-license-{{lc:{{BASEPAGENAME}}}}-text}}|current translations]]).
|msg-localization-ext-translate=This template makes use of {{tl|Autotranslate}} and [[:mw:Special:MyLanguage/Help:Extension:Translate|the translate extension]].
|msg-localization-instruct-ext-translate=Translate this template now!
|msg-localization-instruct-ext-translate-admin=Administrate translations.
| msg-localization-tnt = This template is localized using [[Module:TNT]].
<!-- $1 is automatically replaced by [[Template:TemplateBox/layout]] using {{tmpl}} -->
| msg-localization-instruct-tnt = These translations are stored in $1.
|msg-seealso={{int:Seealso}}
|msg-relieson=Relies on:
|msg-intendedusergroups=The template is intended to be used by the following user groups:
|msg-intendedusergroups-all=[[Commons:Users|all users]]
|msg-intendedusergroups-bot=[[{{int:Grouppage-bot}}|{{int:Group-bot}}]]
|msg-intendedusergroups-admin=[[{{int:Grouppage-sysop}}|{{int:Group-sysop}}]]
|msg-intendedusergroups-bureaucrat=[[{{int:Grouppage-bureaucrat}}|{{int:Group-bureaucrat}}]]
|msg-intendedusergroups-checkuser=[[{{int:Grouppage-checkuser}}|{{int:Group-checkuser}}]]
|msg-intendedusergroups-imagereviewer=[[{{int:Grouppage-Image-reviewer}}|{{int:Group-Image-reviewer}}]]
|msg-intendedusergroups-vrt=[[{{int:grouppage-vrt-permissions}}|{{int:group-vrt-permissions}}]]
|msg-intendedusergroups-autoconfirmed=[[{{int:Grouppage-autoconfirmed}}|{{int:Group-autoconfirmed}}]]
|msg-intendedusergroups-autopatrolled=[[{{int:Grouppage-autopatrolled}}|{{int:Group-autopatrolled}}]]
|msg-intendedusergroups-filemover=[[{{int:Grouppage-filemover}}|{{int:Group-filemover}}]]
|msg-intendedusergroups-oversight=[[{{int:Grouppage-oversight}}|{{int:Group-oversight}}]]
|msg-intendedusergroups-patroller=[[{{int:Grouppage-patroller}}|{{int:Group-patroller}}]]
|msg-intendedusergroups-rollbacker=[[{{int:Grouppage-rollbacker}}|{{int:Group-rollbacker}}]]
|msg-intendedusergroups-upwizcampeditors=[[{{int:Grouppage-upwizcampeditors}}|{{int:Group-upwizcampeditors}}]]
|msg-intendedusergroups-translationadmin=[[{{int:Grouppage-translationadmin}}|{{int:Group-translationadmin}}]]
|msg-intendedusergroups-steward=[[{{int:Grouppage-steward}}|{{int:Group-steward}}]]
|msg-intendedusergroups-templateeditor=[[{{int:Grouppage-templateeditor}}|{{int:Group-templateeditor}}]]
|msg-intendedusergroups-unspecified=no user group specified
|msg-intendednamespaces=The template is intended to be used in the following namespaces:
|msg-intendednamespaces-unknown=unknown
|msg-intendednamespaces-all=all namespaces
|msg-intendednamespaces-talks=all talk namespaces and noticeboards
|msg-intendednamespaces-contents=all content namespaces
|msg-intendednamespaces-0=the main or gallery namespace (unprefixed)
|msg-intendednamespaces-1=the Talk namespace for the main namespace
|msg-intendednamespaces-2=the User namespace
|msg-intendednamespaces-3=the User talk namespace
|msg-intendednamespaces-4=the Commons namespace
|msg-intendednamespaces-5=the Commons talk namespace
|msg-intendednamespaces-6=the File namespace
|msg-intendednamespaces-7=the File talk namespace
|msg-intendednamespaces-8=the MediaWiki namespace
|msg-intendednamespaces-9=the MediaWiki talk namespace
|msg-intendednamespaces-10=the Template namespace
|msg-intendednamespaces-11=the Template talk namespace
|msg-intendednamespaces-12=the Help namespace
|msg-intendednamespaces-13=the Help talk namespace
|msg-intendednamespaces-14=the Category namespace
|msg-intendednamespaces-15=the Category talk namespace
|msg-intendednamespaces-16=the Creator namespace
|msg-intendednamespaces-17=the Creator talk namespace
|msg-intendednamespaces-18=the Special namespace
|msg-intendednamespaces-default=no namespace specified
|msg-placement=Placement:
|msg-placement-top=At the top of the page
|msg-placement-bottom=At the bottom of the page
|msg-placement-licence=In the "{{int:wm-license-information-permission}}" parameter of the {{tl|Information}} template (or the respective parameter of similar templates) or in the "{{int:license-header}}" section
|msg-placement-source=In the "{{int:wm-license-information-source}}" parameter of the {{tl|Information}} template (or the respective parameter of similar templates) or just below this template
|lang={{#invoke:Caller title|lang|base=Template:TemplateBox/i18n}}
}}</onlyinclude>
{{translated tag|documentation}}
7e1b1185fddca394a27eedc669bdd2a619db2da5
Module:Hatnote
828
152
353
2022-01-04T17:41:17Z
en>Nihiltres
0
Updated from sandbox with namespace filtering for maintenance category
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(inline == 1 and 'hatnote-inline' or 'hatnote')
:addClass('navigation-not-searchable')
:addClass(extraclasses)
:addClass(options.selfref and 'selfref')
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
44d8f670e8ea9780e48425da6da49c8a5ba1fc20
Main Page
0
1
1
2022-01-05T03:35:32Z
MediaWiki default
1
Create main page
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
21236ac3f8d65e5563b6da6b70815ca6bf1e6616
File:Cvrf logo black.png
6
2
2
2022-01-05T04:03:14Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Favicon.ico
6
3
3
2022-01-05T04:10:23Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Cvrf background.png
6
4
4
2022-01-05T04:30:36Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Rules
0
5
5
2022-01-05T07:16:36Z
TheSink
2
Add initial contribution rules
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
d1d4adbc92ea1e4cc48c27c72ac435daa7106c7e
File:20210702 154606657.png
6
6
6
2022-01-05T07:32:11Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:20210702 155324545.png
6
7
7
2022-01-05T07:32:36Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:20210702 155143411.png
6
8
8
2022-01-05T07:32:53Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:20210702 155053802.png
6
9
9
2022-01-05T07:33:10Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Main Page
0
1
10
1
2022-01-05T07:35:00Z
TheSink
2
Add initial main page content
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="slideshow">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
[https://discord.gg/ytBqnKN Join our Discord server]
ddc3b9e96adabacda9719dcf80b092d67f466ef0
11
10
2022-01-05T07:36:18Z
TheSink
2
Switch gallery view mode
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery>
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
[https://discord.gg/ytBqnKN Join our Discord server]
33849167eeb6a9b1170875027b9fc4456a5a55e5
12
11
2022-01-05T07:37:51Z
TheSink
2
Switch gallery view mode *again*
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
[https://discord.gg/ytBqnKN Join our Discord server]
9e831961d82adb782d7b302d0cdf3e0c3dc217e7
14
12
2022-01-05T08:04:26Z
TheSink
2
Add screenshot credit note
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
[https://discord.gg/ytBqnKN Join our Discord server]
8e0def36308e277407283a863e6fbef587e506d4
15
14
2022-01-05T08:05:25Z
TheSink
2
Add link to Taiga
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
4700e40f0818336a68fbca85d97a1e66845e1ef9
17
15
2022-01-06T05:35:39Z
TheSink
2
Update community/links section
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="slideshow">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
42ea0c8c93f1f16a28b0244f6bcff579f80d4606
18
17
2022-01-06T05:36:10Z
TheSink
2
Disable slideshow view (wayyy too big)
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
ade8a84d55d4d74886f5941c6fdceb539b929b05
26
18
2022-01-06T06:40:01Z
AyScorch
5
Added Useful Pages
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
a0a5c500d163970686f3712b209475b9ca9d0a79
34
26
2022-01-07T05:11:22Z
Lule34567
6
Added "previously known, JKRF" to clarify history as well as adding year game production started
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (previously known, ''JKRF''. abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers and has been in production since 2015.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
620e4096c4ad41f59d95e0240783da744bdad64f
37
34
2022-01-07T05:25:10Z
Lule34567
6
Fixed Typo
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (previously known, ''JKRF''. abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers and has been in production since 2015.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
04fa0b1438eabb88bb8fbf80220345d2384486c7
39
37
2022-01-07T05:37:24Z
Lule34567
6
Added link to WIP Contribution Hub
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (previously known, ''JKRF''. abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers and has been in production since 2015.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
8bf0cd7e7efa96acbaa2fdfa83854a528170788d
40
39
2022-01-07T05:45:48Z
Lule34567
6
Corrected previous names to add hyptek.
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (previously known as ''JKRF and HTRF''. abbreviated ''CVRF'') is a science-oriented exploration game being developed on Roblox. It is developed by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JK Production''] with 2 active developers and has been in production since 2015.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
83f19f055094fd88030f2af94fd1340e08768f92
44
40
2022-01-07T06:02:59Z
ChromeEight
7
Added to introduction
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
''[https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility Cobalt Valley Research Facility]'' (previously known as ''JKRF and HTRF''. abbreviated ''CVRF'') is a science-oriented exploration and roleplay game on [https://en.wikipedia.org/wiki/Roblox Roblox]. It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
ce59f9d9a25bca42963df3feb2f2886eb11f5ef7
46
44
2022-01-07T06:06:24Z
ChromeEight
7
Added again
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the JKR Research Facility (JKRF) from 2015 to 2017 and also as the Hyptek Research Facility (HTRF) from 2017 to 2019 until it was changed to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
c599f789d16ce73994752f587b3bd82b024c307a
48
46
2022-01-07T06:17:41Z
ChromeEight
7
Protected "[[Main Page]]": High traffic page ([Edit=Allow only logged in users] (indefinite) [Move=Allow only logged in users] (indefinite))
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the JKR Research Facility (JKRF) from 2015 to 2017 and also as the Hyptek Research Facility (HTRF) from 2017 to 2019 until it was changed to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
c599f789d16ce73994752f587b3bd82b024c307a
49
48
2022-01-07T06:24:19Z
Lule34567
6
Added extra word in order to make it sound more formal.
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the JKR Research Facility (JKRF) from 2015 to 2017 and also as the Hyptek Research Facility (HTRF) from 2017 to 2019 until it was changed back to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
[[Contribution Hub]]
101f0312d77413ccbdf9528253c6b63fa512f224
51
49
2022-01-07T07:18:01Z
AyScorch
5
Please use
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the JKR Research Facility (JKRF) from 2015 to 2017 and also as the Hyptek Research Facility (HTRF) from 2017 to 2019 until it was changed back to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>Screenshots by ruvir</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]] and [[Contribution Hub]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
c3a86f40f15980d4ab72152ee75b1078db274d70
MediaWiki:Common.css
8
10
13
2022-01-05T07:52:25Z
TheSink
2
Hide cosmos toolbar
css
text/css
#cosmos-toolbar {
display: none;
}
c1bf580f396fb226c97007640b23b18bf4a1555d
Module:TemplateBox
828
68
151
2022-01-05T08:00:07Z
mw>NguoiDungKhongDinhDanh
0
Change tt tags to span tags ([[Special:Permalink/618578903#footer|request]])
Scribunto
text/plain
require('Module:No globals')
--[[
@exports
usagesample( frame )
argcount( frame )
args2table( args, onGetKey, forCustom )
paramtable( frame )
description( frame )
templatedata( frame )
]]
local p = {}
-- Helper function, not exposed
local function tobool(st)
if type( st ) == 'string' then
return st == 'true'
else
return not not st
end
end
-- Required to determine in which languages the interface texts without langcode are
local contentLangcode = mw.language.getContentLanguage():getCode()
-- Forward declaration
local msg, langIsInit, userLang
local messagePrefix = "templatedata-doc-"
local i18n = {}
i18n['params'] = "Template parameters"
i18n['param-name'] = "Parameter"
i18n['param-desc'] = "Description"
i18n['param-type'] = "Type"
i18n['param-default'] = "Default"
i18n['param-status'] = "Status"
i18n['param-status-optional'] = "optional"
i18n['param-status-required'] = "required"
i18n['param-status-suggested'] = "suggested"
i18n['param-status-deprecated'] = "deprecated"
i18n['param-default-empty'] = "empty"
local function initLangModule(frame)
if langIsInit then
return
end
userLang = frame:preprocess( '{{int:lang}}' )
--! From [[:de:Modul:Expr]]; by [[:de:User:PerfektesChaos]];
--! Derivative work: Rillke
msg = function( key )
-- Retrieve localized message string in content language
-- Precondition:
-- key -- string; message ID
-- Postcondition:
-- Return some message string
-- Uses:
-- > messagePrefix
-- > i18n
-- > userLang
-- mw.message.new()
local m = mw.message.new( messagePrefix .. key )
local r = false
if m:isBlank() then
r = i18n[ key ]
else
m:inLanguage( userLang )
r = m:plain()
end
if not r then
r = '((('.. key .. ')))'
end
return r
end -- msg()
langIsInit = true
end
-- A "hash" / table of everything TemplateData takes
-- to ease maintenance.
-- The type is automatically determined if t is omitted.
-- If the type does not match or can't be converted, an error will be thrown!
-- Available types (LUA-Types with exceptions):
-- InterfaceText, boolean, number, selection, table, string
-- selection*: - requires a selection-string of pipe-separated possibilities to be supplied
-- InterfaceText*: A free-form string (no wikitext) in the content-language of the wiki, or,
-- an object containing those strings keyed by language code.
local paraminfoTemplate = {
description = {
default = '',
t = 'InterfaceText',
alias = 'desc'
},
format = {
default = 'inline',
t = 'selection',
selection = 'inline|block',
alias = 'print',
extract = function(pargs, number, paramVal)
local m = { multi = 'block', one = 'inline', infobox = 'block' }
return m[paramVal] or 'inline'
end
}
}
local paraminfoTLParams = {
label = {
default = '',
t = 'InterfaceText'
},
required = {
default = false,
extract = function(pargs, number, paramVal)
local req = (pargs[number .. 'stat'] == 'required')
return tobool( paramVal or req )
end
},
suggested = {
default = false,
extract = function(pargs, number, paramVal)
local sugg = (pargs[number .. 'stat'] == 'suggested')
return tobool( paramVal or sugg )
end
},
description = {
default = '',
t = 'InterfaceText',
alias = 'd'
},
deprecated = {
default = false,
extract = function(pargs, number, paramVal)
local depr = (pargs[number .. 'stat'] == 'deprecated')
return tobool( paramVal or depr )
end
},
aliases = {
default = '',
t = 'table',
extract = function(pargs, number, paramVal)
local key = number .. 'aliases'
local tdkey = key .. '-td'
local aliases = pargs[tdkey] or pargs[key]
if aliases and mw.text.trim( aliases ) ~= '' then
local cleaned = {}
for m in mw.text.gsplit( aliases, '/', true ) do
cleaned[#cleaned+1] = mw.text.trim(m)
end
return cleaned
else
return nil
end
end
},
default = {
default = '',
t = 'string',
alias = 'def'
},
type = {
default = 'unknown',
t = 'selection',
selection = 'unknown|number|string|string/wiki-user-name|string/wiki-page-name|string/line|line|wiki-page-name|wiki-file-name|wiki-user-name|wiki-template-name|content|unbalanced-wikitext|date|url|boolean'
},
inherits = {
default = nil,
t = 'string'
},
autovalue = {
default = '',
t = 'string',
alias = 'av',
},
suggestedvalues = {
default = '',
t = 'table',
alias = 'sv',
extract = function(pargs, number, paramVal)
if paramVal == nil then
return nil
end
local cleaned = {}
for m in mw.text.gsplit( paramVal, '/', true ) do
cleaned[#cleaned+1] = mw.text.trim(m)
end
return cleaned
end,
},
-- sets will be treated differently because we can only have a plain structure in wikitext
}
local tableLayout = {
{
col = 'param-name',
width = '15%',
extract = function(item, renderCell, monolingual)
local alias, param = '', item.key
local aliasTT = '<span style="font-family: monospace; color:#777; border:1px solid #6A6A6A">'
param = '<code>' .. param .. '</code>'
if item.aliases then
alias = aliasTT .. table.concat(item.aliases, '</span><br />' .. aliasTT) .. '</span>'
param = table.concat({param, '<br /><div>', alias, '</div>'})
end
renderCell(param)
end
}, {
col = 'param-desc',
cols = 2,
width = '65%',
extract = function(item, renderCell, monolingual)
local label = item.label or ''
label = monolingual(label)
local labelLen = #label
local colspan = 2 - labelLen
if labelLen > 0 then
renderCell(label)
end
renderCell(monolingual(item.description), colspan)
end
}, {
col = 'param-default',
width = '10%',
extract = function(item, renderCell, monolingual)
local def = monolingual(item.default) or ''
if #def == 0 then
def = '<span class="mw-templatedata-doc-muted" style="color:#777; font-variant:small-caps">' .. msg('param-default-empty') .. '</span>'
end
renderCell(def)
end
}, {
col = 'param-status',
width = '10%',
extract = function(item, renderCell, monolingual)
local stat = msg('param-status-optional')
if item.required then
stat = '<b>' .. msg('param-status-required') .. '</b>'
elseif item.deprecated then
stat = msg('param-status-deprecated')
elseif item.suggested then
stat = msg('param-status-suggested')
end
renderCell(stat)
end
}
}
-- Initialize param info
-- Avoids having to add redundant information to the preceding tables
local function init( which )
local setDefault = function(v)
if v.t == nil and v.default ~= nil then
v.t = type( v.default )
end
if v.selection then
local selection = mw.text.split(v.selection, '|', true)
v.selection = {}
for _, sel in ipairs(selection) do
v.selection[sel] = true
end
end
end
for a, v in pairs( which ) do
setDefault(v)
end
end
local function initParamTables()
init( paraminfoTemplate )
init( paraminfoTLParams )
end
------------------------------------------------------
-------------------- USAGE PART ----------------------
------------------------------------------------------
function p.argcount( frame )
local pargs = ( frame:getParent() or {} ).args or {}
local ac = 0
for i, arg in pairs( pargs ) do
if ('number' == type(i)) then
ac = ac + 1
end
end
return ac
end
function p.usagesample( frame )
local pargs = ( frame:getParent() or {} ).args or {}
local multiline = (pargs.lines == 'multi' or pargs.print == 'multi' or pargs.print == 'infobox')
local align = pargs.print == 'infobox'
if not pargs.lines and not pargs.print and pargs.type == 'infobox' then
multiline = true
align = true
end
local sepStart = ' |'
local sepEnd = multiline and '\n' or ''
local sep = sepEnd
local subst = #(pargs.mustbesubst or '') > 0 and 'subst:' or ''
local beforeEqual = multiline and ' ' or ''
local equal = beforeEqual .. '= '
local templateTitle = pargs.name or ''
local args, argName, result = {}
local maxArgLen, eachArg = 0
sep = sep .. sepStart
local sparseIpairs = require('Module:TableTools').sparseIpairs
local comapareLegacyVal = function(val)
return val == 'optional-' or val == 'deprecated'
end
local shouldShow = function(i)
if comapareLegacyVal(pargs[i .. 'stat']) or
comapareLegacyVal(pargs[i .. 'stat-td']) or
pargs[i .. 'deprecated'] == true then
return false
end
return true
end
eachArg = function(cb)
for i, arg in sparseIpairs( pargs ) do
if ('number' == type(i)) then
argName = mw.text.trim( arg or '' )
if #argName == 0 then
argName = tostring(i)
end
if shouldShow(i) then
cb(argName)
end
end
end
end
if align then
eachArg(function( arg )
local argL = #arg
maxArgLen = argL > maxArgLen and argL or maxArgLen
end)
end
eachArg(function( arg )
local space = ''
if align then
space = (' '):rep(maxArgLen - #arg)
end
table.insert( args, argName .. space .. equal )
end)
if #args == 0 then
sep = ''
sepEnd = ''
sepStart = ''
end
if #templateTitle == 0 then
templateTitle = mw.title.getCurrentTitle().text
end
result = table.concat( args, sep )
result = table.concat({ mw.text.nowiki('{{'), subst, templateTitle, sep, result, sepEnd, '}}' })
if multiline then
-- Preserve whitespace in front of new lines
result = frame:callParserFunction{ name = '#tag', args = { 'poem', result } }
end
return result
end
------------------------------------------------------
------------------- GENERAL PART ---------------------
------------------------------------------------------
function p.args2table(args, onGetKey, consumer)
initParamTables()
local sets, asParamArray, laxtype, processParams, processDesc, unstrip
if 'paramtable' == consumer then
asParamArray = true
processParams = true
laxtype = true
elseif 'templatedata' == consumer then
sets = true
processParams = true
processDesc = true
unstrip = true
elseif 'description' == consumer then
processDesc = true
laxtype = true
end
-- All kind of strange stuff with the arguments is done, so play safe and make a copy
local pargs = mw.clone( args )
-- Array-like table containing all parameter-numbers that were passed
local templateArgs = {}
-- Arguments that are localized (i.e. the user passed 1desc-en=English description of parameter one)
local i18nTemplateArgs = {}
-- Ensure that tables end up as array/object (esp. when they are empty)
local tdata = {description="", params={}, sets={}}
local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject
local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray
setmetatable(tdata.params, isObject)
setmetatable(tdata.sets, isArray)
onGetKey = onGetKey or function( prefix, alias, param )
local key, key2, tdkey, tdkey2
key = prefix .. (alias or param)
key2 = prefix .. param
tdkey = key .. '-td'
tdkey2 = key2 .. '-td'
return tdkey, tdkey2, key, key2
end
local extractData = function( pi, number )
local prefix = number or ''
local ppv, paramVal
local key1, key2, key3, key4
local paramKey, paramTable, processKey
if number then
paramKey = mw.text.trim( pargs[number] )
if '' == paramKey then
paramKey = tostring( number )
end
paramTable = {}
if asParamArray then
paramTable.key = paramKey
table.insert(tdata.params, paramTable)
else
tdata.params[paramKey] = paramTable
end
end
for p, info in pairs( pi ) do
key1, key2, key3, key4 = onGetKey(prefix, info.alias, p)
paramVal = nil
processKey = function(key)
if paramVal ~= nil then return end
local plain, multilingual = pargs[key], i18nTemplateArgs[key]
paramVal = multilingual or plain
end
processKey( key1 )
processKey( key2 )
processKey( key3 )
processKey( key4 )
-- Ensure presence of entry in content language
ppv = pargs[key1] or pargs[key2] or pargs[key3] or pargs[key4] or info.default
if 'table' == type( paramVal ) then
if (nil == paramVal[contentLangcode]) then
paramVal[contentLangcode] = ppv
end
else
paramVal = ppv
end
if 'function' == type( info.extract ) then
if 'string' == type( paramVal ) then
paramVal = mw.text.trim( paramVal )
if '' == paramVal then
paramVal = nil
end
end
paramVal = info.extract( pargs, number, paramVal )
end
local insertValue = function()
if number then
paramTable[p] = paramVal
else
tdata[p] = paramVal
end
end
if info.selection then
if info.selection[paramVal] then
insertValue()
end
elseif 'InterfaceText' == info.t then
if ({ table=1, string=1 })[type( paramVal )] then
insertValue()
end
else
local paramType = type( paramVal )
if 'string' == info.t and 'string' == paramType then
paramVal = mw.text.trim( paramVal )
if '' ~= paramVal then
insertValue()
end
elseif 'boolean' == info.t then
paramVal = tobool(paramVal)
insertValue()
elseif 'number' == info.t then
paramVal = tonumber(paramVal)
insertValue()
elseif paramType == info.t then
insertValue()
elseif paramType == 'nil' then
-- Do nothing
elseif not laxtype and 'string' == info.t and 'table' == paramType then
-- Convert multilingual object into content language string
paramVal = paramVal[contentLangcode]
insertValue()
else
if laxtype then
insertValue()
else
error( p .. ': Is of type ' .. paramType .. ' but should be of type ' .. (info.t or 'unknown'), 1 )
end
end
end
end
-- Now, treat sets
if sets then
key1 = prefix .. 'set-td'
key2 = prefix .. 'set'
paramVal = pargs[key1] or pargs[key2]
if paramVal then
local found = false
for i, s in ipairs( tdata.sets ) do
if s.label == paramVal then
table.insert( s.params, p )
found = true
end
end
if not found then
table.insert( tdata.sets, {
label = paramVal,
params = { p }
} )
end
end
end
end
-- First, analyse the structure of the provided arguments
for a, v in pairs( pargs ) do
if unstrip then
v = mw.text.unstrip( v )
pargs[a] = v
end
if type( a ) == 'number' then
table.insert( templateArgs, a )
else
local argSplit = mw.text.split( a, '-', true )
local argUnitl = {}
local argAfter = {}
local isTDArg = false
local containsTD = a:find( '-td', 1, true )
for i, part in ipairs( argSplit ) do
if isTDArg or (containsTD == nil and i > 1) then
-- This is likely a language version
table.insert( argAfter, part )
else
table.insert( argUnitl, part )
end
if part == 'td' then
isTDArg = true
end
end
if #argAfter > 0 then
argUnitl = table.concat( argUnitl, '-' )
argAfter = table.concat( argAfter, '-' )
i18nTemplateArgs[argUnitl] = i18nTemplateArgs[argUnitl] or {}
i18nTemplateArgs[argUnitl][argAfter] = v
end
end
end
-- Then, start building the actual template
if processDesc then
extractData( paraminfoTemplate )
end
if processParams then
-- Ensure that `templateArgs` contains indicies in ascending order
table.sort( templateArgs )
for i, number in pairs( templateArgs ) do
extractData( paraminfoTLParams, number )
end
end
return tdata, #templateArgs
end
------------------------------------------------------
------------ CUSTOM PARAMETER TABLE PART -------------
------------------------------------------------------
-- A custom key-pref-function
local customOnGetKey = function( prefix, alias, param )
local key, key2, tdkey, tdkey2
key = prefix .. (alias or param)
key2 = prefix .. param
tdkey = key .. '-td'
tdkey2 = key2 .. '-td'
return key2, key, tdkey2, tdkey
end
local toUserLanguage = function(input)
if type(input) == 'table' then
input = require( 'Module:LangSwitch' )._langSwitch( input, userLang ) or ''
end
return input
end
function p.description(frame)
local pargs = ( frame:getParent() or {} ).args or {}
-- Initialize the language-related stuff
initLangModule(frame)
local tdata, paramLen
tdata, paramLen = p.args2table(pargs, customOnGetKey, 'description')
return toUserLanguage(tdata.description)
end
function p.paramtable(frame)
local pargs = ( frame:getParent() or {} ).args or {}
local tdata, paramLen
if 'only' == pargs.useTemplateData then
return 'param table - output suppressed'
end
-- Initialize the language-related stuff
initLangModule(frame)
tdata, paramLen = p.args2table(pargs, customOnGetKey, 'paramtable')
if 0 == paramLen then
return ''
end
local row, rows = '', {}
local renderCell = function(wikitext, colspan)
local colspan, oTd = colspan or 1, '<td>'
if colspan > 1 then
oTd = '<td colspan="' .. colspan .. '">'
end
row = table.concat({ row, oTd, wikitext, '</td>' })
end
-- Create the header
for i, field in ipairs( tableLayout ) do
local style = ' style="width:' .. field.width .. '"'
local colspan = ''
if field.cols then
colspan = ' colspan="' .. field.cols .. '"'
end
local th = '<th' .. style .. colspan .. '>'
row = row .. th .. msg(field.col) .. '</th>'
end
table.insert(rows, row)
-- Now transform the Lua-table into an HTML-table
for i, item in ipairs( tdata.params ) do
row = ''
for i2, field in ipairs( tableLayout ) do
field.extract(item, renderCell, toUserLanguage)
end
table.insert(rows, row)
end
return '<table class="wikitable templatebox-table"><tr>' .. table.concat(rows, '</tr><tr>') .. '</tr></table>'
end
------------------------------------------------------
----------------- TEMPLATEDATA PART ------------------
------------------------------------------------------
-- A real parser/transformer would look differently but it would likely be much more complex
-- The TemplateData-portion for [[Template:TemplateBox]]
function p.templatedata(frame)
local tdata
local args = frame.args or {}
local formatting = args.formatting
local pargs = ( frame:getParent() or {} ).args or {}
local useTemplateData = pargs.useTemplateData
if (formatting == 'pretty' and useTemplateData ~= 'export') or
(not useTemplateData) or
(useTemplateData == 'export' and formatting ~= 'pretty') then
local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
mw.log(warning)
tdata = '{"description":"' .. warning .. '","params":{},"sets":[]}'
return tdata
end
-- Load the JSON-Module which will convert LUA tables into valid JSON
local JSON = require('Module:JSON')
JSON.strictTypes = true
-- Obtain the object containing info
tdata = p.args2table(pargs, nil, 'templatedata')
-- And finally return the result
if formatting == 'pretty' then
return JSON:encode_pretty(tdata)
else
return JSON:encode(tdata)
end
end
return p
5012975efde71b42159a90db1abc19cdb0afb9a0
File:Cvrf logo 160px.png
6
11
16
2022-01-06T05:23:22Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Account-hard-hat.svg
6
12
19
2022-01-06T06:09:05Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Template:Page under construction
10
13
20
2022-01-06T06:21:17Z
TheSink
2
Add under construction template
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} is currently <b>under construction</b>. You can help {{SITENAME}} by [{{fullurl:{{FULLPAGENAME}}|action=edit}} improving it].''</span></div>
56e05dc84143979428642a3dcdf1a4028b93c022
User:AyScorch
2
17
24
2022-01-06T06:25:58Z
AyScorch
5
page start
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server. I've been with JKR since like 2015 iirc.
895ef4a22bd5f3042b885d4ea8049f9588795c0f
30
24
2022-01-06T07:05:05Z
AyScorch
5
Added Find Me
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|}
b34333a11fcab440e8f515e604272170829769d3
Template:Work in progress
10
14
21
2022-01-06T06:30:55Z
TheSink
2
Add content work in progress notice
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} relates to content that is a <b>work in progress</b>. Some or all of the content described may be inaccessible, unusable, or broken.''</span></div>
<noinclude>Keep in mind, this template should be used on pages that <b>DESCRIBE</b> work-in-progress content. For pages that are themselves a work in progress, use [[Template:Page_under_construction]].</noinclude>
00309d3487a8cfb871a5905471d72bcf45b27c65
28
21
2022-01-06T06:56:41Z
TheSink
2
Edit work in progress template text
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} relates to content that is a <b>work in progress</b>. Some or all of the content described may be inaccessible, unusable, or broken - especially in the release branch.''</span></div>
<noinclude>Keep in mind, this template should be used on pages that <b>DESCRIBE</b> work-in-progress content. For pages that are themselves a work in progress, use [[Template:Page_under_construction]].</noinclude>
100c068f59aefb488be88ff61ef85425830a7b2c
29
28
2022-01-06T06:58:24Z
TheSink
2
Edit work in progress template text *again*
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} relates to content that is a <b>work in progress</b>. Some or all of the content described may be inaccessible, unusable, broken, or even completely nonexistent - especially in the release branch.''</span></div>
<noinclude>Keep in mind, this template should be used on pages that <b>DESCRIBE</b> work-in-progress content. For pages that are themselves a work in progress, use [[Template:Page_under_construction]].</noinclude>
f2844043496123236ce9589a7ba427f32c923050
Facility Locations
0
16
23
2022-01-06T06:33:06Z
AyScorch
5
Added WIP header
wikitext
text/x-wiki
{{Template:Page_under_construction}}
==Sector A - Geothermal Sublevel==
*Turbine Hall
*Tram Station 1
*Atrium
==Sector B - Maintenance and Utilities Sector==
Work In Progress
==Sector C - General Research and Development Sector==
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium
*Atrium Lounge
*Maintenance Walkway
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
Work In Progress
==Sector E - Materials Research and Handling Sector==
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
__FORCETOC__
e099d65583f91038179795f796880178ea985cae
25
23
2022-01-06T06:38:27Z
AyScorch
5
Added link to Reception Lobby
wikitext
text/x-wiki
{{Template:Page_under_construction}}
==Sector A - Geothermal Sublevel==
*Turbine Hall
*Tram Station 1
*Atrium
==Sector B - Maintenance and Utilities Sector==
Work In Progress
==Sector C - General Research and Development Sector==
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium
*Atrium Lounge
*Maintenance Walkway
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
* [[Reception Lobby (location)|Reception Lobby]]
==Sector E - Materials Research and Handling Sector==
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
__FORCETOC__
07b9fca50204126bfd852ac2c081db045ebf9bc3
31
25
2022-01-06T18:12:30Z
AyScorch
5
Added sector descriptions
wikitext
text/x-wiki
{{Template:Page_under_construction}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
Work In Progress
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 3 and 4 and houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium
*Atrium Lounge
*Maintenance Walkway
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans level 5 (while the Control Room dips into Level 4) and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas.
* [[Reception Lobby (location)|Reception Lobby]]
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
__FORCETOC__
1408fa8742a6b55e0553060f77df6b79dfcacbdc
32
31
2022-01-06T23:27:21Z
AyScorch
5
added things
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 3 and 4 and houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*Cafeteria
*Freight Checkpoint
*Topside Stairwell
*Tram Station 3
*Infirmary
*Living Quarters
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* Atrium
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
a4953555edc09f59a604fa349ede4a5337f07766
Reception lobby
0
15
22
2022-01-06T06:33:21Z
TheSink
2
Add page for reception lobby
wikitext
text/x-wiki
{{Template:Page_under_construction}}
The '''Reception Lobby''' is a location on [[Level 4]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
[[Category:Locations]]
7ebea15163df6dd28798224e3fb38bc09c554f36
User:TheSink
2
18
27
2022-01-06T06:48:35Z
TheSink
2
Add user page
wikitext
text/x-wiki
Hello! I'm a CVRF developer and owner of this wiki. You can contact me on Discord at ''The_Sink#4096''.
62fa07d0f0abd04e17d88d06a8d6fef147636ff1
User:Lule34567
2
19
33
2022-01-07T05:01:25Z
Lule34567
6
first edit
wikitext
text/x-wiki
Lule34567, also named Parzival, is a 2016 Roblox user who has played JKRF since before the removal of trains. If needed, you may contact me at robertson3736@gmail.com.
Thank you.
b781fc478d0897b38b6cd3e29d3f3658ab61838b
Rules
0
5
35
5
2022-01-07T05:15:14Z
Lule34567
6
Added new rule about editing pages. Will add an addendum about editing summaries
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users.
a48ec62fd50230c59061eb02812c1542637bafd9
52
35
2022-01-07T07:23:02Z
AyScorch
5
Added a rule
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users.
*Use comments for editor notes. Placing it just in the wiki doesn't exactly look good.
cffc51934ddcbba80c83b0c3fdeac3a3e1726eec
53
52
2022-01-07T07:26:20Z
AyScorch
5
/* Contributing */
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users.
*Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
9d1c5cfa107950a122cda7d88b9100dbb147f11e
56
53
2022-01-07T07:34:48Z
TheSink
2
Add note about the scope of contribution guidelines
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
606e025917713fae96297075e70cb564f64982ee
Talk:Main Page
1
20
36
2022-01-07T05:23:43Z
Lule34567
6
Created page with "'''Oops!''' It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki! We are working as hard as we can in order to make this possible so hold on tight! Sincerely, Parzival --~~~~"
wikitext
text/x-wiki
'''Oops!'''
It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki!
We are working as hard as we can in order to make this possible so hold on tight!
Sincerely,
Parzival
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 05:23, 7 January 2022 (UTC)
0ab20ee3c30e00cf6d2cc729a4a818a4f1a89ea1
42
36
2022-01-07T05:56:20Z
Lule34567
6
wikitext
text/x-wiki
'''Oops!'''
It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki!
We are working as hard as we can in order to make this possible so hold on tight!
Sincerely,
Parzival
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 05:23, 7 January 2022 (UTC)
<iframe width="550" height="350" scrolling="no" src="https://widget.mibbit.com/?settings=8ad8f5784276a2539aaaf330fa3ccb6c&server=irc.mibbit.net%3A%2B6697&channel=%23lule34567_test"></iframe>
3645b612c37aca791bf1fedd058080bdac1dd9c1
47
42
2022-01-07T06:09:24Z
Lule34567
6
wikitext
text/x-wiki
'''Oops!'''
It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki!
We are working as hard as we can in order to make this possible so hold on tight!
Sincerely,
Parzival
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 05:23, 7 January 2022 (UTC)
P.S. Discuss here via IRC.
https://widget.mibbit.com/?settings=8ad8f5784276a2539aaaf330fa3ccb6c&server=irc.mibbit.net%3A%2B6697&channel=%23CVRF_Wiki
b4c5ee12f74f024c37b2c5d16a53cc359e3db7be
Contribution Hub
0
21
38
2022-01-07T05:35:49Z
Lule34567
6
Created page with "'''Welcome to the Contribution Hub!''' Welcome User! Here you'll find some tips and tricks for making, editing or contributing to pages! Currently this page is WIP, but at the moment, you can browse the rest of wiki and maybe make some minor edits to get started on your volunteer job! Be careful though, all your edits and contributions are logged in [[https://wiki.jkr.productions/w/index.php?title=Main_Page&action=history|the edit history]] so make sure to not violate a..."
wikitext
text/x-wiki
'''Welcome to the Contribution Hub!'''
Welcome User!
Here you'll find some tips and tricks for making, editing or contributing to pages! Currently this page is WIP, but at the moment, you can browse the rest of wiki and maybe make some minor edits to get started on your volunteer job! Be careful though, all your edits and contributions are logged in [[https://wiki.jkr.productions/w/index.php?title=Main_Page&action=history|the edit history]] so make sure to not violate any rules!
Rules for contributing can be found here: https://wiki.jkr.productions/wiki/Rules
Thanks for coming by and we can't wait to see your new impacts!
4f3e2cd1de736daba18c82d17244515f2b91c07e
50
38
2022-01-07T06:30:01Z
Lule34567
6
Added banner for WIP notice.
wikitext
text/x-wiki
'''<big>Welcome to the Contribution Hub!</big>'''
'''<big>Please Note: This page is Work in Progress! Please do not expect any information here to be done, fixed, or corrected yet!</big>'''
Welcome User!
Here you'll find some tips and tricks for making, editing or contributing to pages! Currently this page is WIP, but at the moment, you can browse the rest of wiki and maybe make some minor edits to get started on your volunteer job! Be careful though, all your edits and contributions are logged in [[https://wiki.jkr.productions/w/index.php?title=Main_Page&action=history|the edit history]] so make sure to not violate any rules!
Rules for contributing can be found here: https://wiki.jkr.productions/wiki/Rules
Thanks for coming by and we can't wait to see your new impacts!
{{DEFAULTSORT:Contribution_HubWIP}}
6a61cadffd42bb007be53d30e285be5811f261be
Talk:Rules
1
23
54
2022-01-07T07:30:30Z
TheSink
2
Created page with ""Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users." This is redundant - contribution rules count for any way a wiki editor can contribute to the wiki, and the rules state what page content should and should not be. I'll add a note to clarify this."
wikitext
text/x-wiki
"Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users."
This is redundant - contribution rules count for any way a wiki editor can contribute to the wiki, and the rules state what page content should and should not be. I'll add a note to clarify this.
4a0123e072f8e5b0e0989049d59ea7cd2e6e0419
55
54
2022-01-07T07:32:18Z
TheSink
2
forgot to sign, oops
wikitext
text/x-wiki
"Editing pages must also follow the rules above, must have a purpose and optionally, be useful for new users."
This is redundant - contribution rules count for any way a wiki editor can contribute to the wiki, and the rules state what page content should and should not be. I'll add a note to clarify this. --[[User:TheSink]] 07:30, 7 January 2022 (UTC)
c6c587f40a74c89b4acf253bb486d4148be83c4a
User talk:AyScorch
3
24
57
2022-01-07T07:37:48Z
AyScorch
5
/* Quick test */ new section
wikitext
text/x-wiki
== Quick test ==
yay! I exist now
d66c596a7371f42e462f515ee3c676ddf0d789fb
User talk:AyScorch
3
24
58
57
2022-01-07T07:44:12Z
AyScorch
5
ya
wikitext
text/x-wiki
== Quick test ==
yay! I exist now
[[User:AyScorch|Scorch]] ([[User talk:AyScorch|talk]]) 07:44, 7 January 2022 (UTC)
209f7db8d570a6d5cc49b65317eee4771d8b24cb
Rules
0
5
59
56
2022-01-07T07:50:17Z
TheSink
2
Protected "[[Rules]]": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented (planned features)
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
606e025917713fae96297075e70cb564f64982ee
67
59
2022-01-07T08:09:41Z
TheSink
2
Add reference to notice templates
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler (i.e. describing secrets or easter eggs)
**Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
**Pages about removed or cancelled features
**Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
302b3e44ec1c8bdcf4d80c446bb18ece8276e3df
70
67
2022-01-07T08:16:49Z
TheSink
2
Add more template links
wikitext
text/x-wiki
==Contributing==
*This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
*Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. NSFW/inappropriate content will result in a ban.
*Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
*Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
**Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
**Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
**Pages about removed or cancelled features ([[Template:Content removed]])
**Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
*You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
*Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
1ea321254db709061007f5806d1e61eaf931e6b1
User:AyScorch
2
17
60
30
2022-01-07T08:02:24Z
AyScorch
5
Added email 1
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|-
|Email*
|aryschorch@gmail.com
|}
8b5d4d73991ace12ba236a94c3cae172900dcea9
63
60
2022-01-07T08:04:36Z
AyScorch
5
email 2
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|-
|Email*
|aryschorch@gmail.com
|}
"* I rarely check Email. Use discord when possible."
ae56b122d42addc00dc6a483de6385dca7f59b92
64
63
2022-01-07T08:05:40Z
AyScorch
5
me when edit source
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|-
|Email•
|aryschorch@gmail.com
|}
• "I rarely check Email. Use discord when possible."
bdd4523195a4b5b9933e075ac33ff8560b548a75
66
64
2022-01-07T08:06:46Z
AyScorch
5
finally
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|-
|Email•
|aryschorch@gmail.com
|}
''• Rarely check. Please use Discord when possible.''
f7f9caac0bb4d12c313565fe4824d7b01e8690cb
MediaWiki:Sidebar
8
25
61
2022-01-07T08:03:30Z
TheSink
2
Add links to sidebar
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
* useful pages
** Rules|Rules
* community links
** https://www.roblox.com/groups/970502/JK-Production#!/about|Roblox group
** https://discord.gg/ytBqnKN|Discord server
** https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline||Project tracker
* SEARCH
* TOOLBOX
* LANGUAGES
04722aaba555d6be787db258d91e36677295984e
62
61
2022-01-07T08:04:16Z
TheSink
2
Fix a few issues with sidebar
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
* Important Articles
** Rules|Rules
* Useful Links
** https://www.roblox.com/groups/970502/JK-Production#!/about|Roblox group
** https://discord.gg/ytBqnKN|Discord server
** https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline|Project tracker
* SEARCH
* TOOLBOX
* LANGUAGES
50ea8f1209b80cd3e06b9e564b8ce4a25806c382
65
62
2022-01-07T08:06:10Z
TheSink
2
Minor sidebar reorganization (hopefully the last edit for now)
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
** Rules|Wiki rules
* Useful Links
** https://www.roblox.com/groups/970502/JK-Production#!/about|Roblox Group
** https://discord.gg/ytBqnKN|Discord Server
** https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline|Project Tracker
* SEARCH
* TOOLBOX
* LANGUAGES
c2499450b887cd77ea113fb62cc0caab60007b84
Template:Spoilers
10
26
68
2022-01-07T08:12:44Z
TheSink
2
Add spoiler notice template
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} may contain <b>spoilers</b> for secret areas, easter eggs, or other content.''</span></div>
859ac34edf161e876777ae09354ad358898002dc
Template:Content removed
10
27
69
2022-01-07T08:14:49Z
TheSink
2
Add cancelled/removed content notice template
wikitext
text/x-wiki
:<div class="notice metadata plainlinks" id="wip"><span style="color:#9c0000">''This {{#switch:{{{1}}} | section = section | article}} describes content that has been <b>removed or cancelled</b>, and thus may not be present in current versions of the game.''</span></div>
c426974a1ca92d53796618f9523db6828bcc5216
Template:Clickable button
10
28
72
71
2022-01-07T08:25:20Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude>{{#if:{{{3|{{{external|}}}}}}
| <span class="plainlinks" {{#if:{{{id|}}}|id="{{{id}}}"}}>[{{{1|{{{target|//parameter_target_is_empty.de}}}}}} <span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
|{{{4|{{{iconPrimary|}}}}}}
|{{{5|{{{iconSecondary|}}}}}}
|{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
}} {{{class|}}}" role="button" aria-disabled="false"><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
|<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}"> </span>
}}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
|<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}"> </span>
}}</span>]</span><!--
-->
| [[{{{1|{{{target|Parameter target is empty!}}}}}}|<span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
|{{{4|{{{iconPrimary|}}}}}}
|{{{5|{{{iconSecondary|}}}}}}
|{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
}} {{{class|}}}" role="button" aria-disabled="false" {{#if:{{{id|}}}|id="{{{id}}}"}}><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
|<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}"> </span>
}}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
|<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}"> </span>
}}</span>]]
}}<!--
--></onlyinclude>
{{documentation}}
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
1e2bf69f76d6d53c1e6f86d2aba7da15ea0518d0
Template:Clickable button 2
10
29
74
73
2022-01-07T08:25:21Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude><span class="plainlinks">[<!--
-->{{#if:{{#invoke:URLutil|isProtocolMW|{{#invoke:URLutil|getURIScheme|1={{{link|{{{1|}}}}}}}}}}
|{{{link|{{{1}}}}}}
|{{#ifeq:{{padleft:|1|{{{link|{{{1|}}}}}}}}|#
|{{fullurl:{{FULLPAGENAME}}{{{link|{{{1}}}}}}}}
|{{fullurl:{{{link|{{{1|#}}}}}}}}
}}
}} <!--
--><span class="ui-button ui-widget ui-state-default ui-corner-all {{#switch:{{{color|{{{Farbe|}}}}}}
|red |red2 |red3 |rot |rot2 |rot3 = ui-button-red
|green|green2|green3|grün|grün2|grün3 = ui-button-green
|blue|blue2|blue3|blau|blau2|blau3 = ui-button-blue
}}" style="vertical-align:middle; {{#switch:{{{color|{{{Farbe|}}}}}}
|rot2 |red2 = background:linear-gradient(to bottom, #e98888 0%, #c97272 90%) !important;
|grün2|green2 = background:linear-gradient(to bottom, #7ddeb3 0%, #72be93 90%) !important;
|blau2|blue2 = background:linear-gradient(to bottom, #88b3f4 0%, #7d9dd4 90%) !important;
|rot3 |red3 = background:linear-gradient(to bottom, #f5e2e2 0%, #963131 90%) !important;
|grün3|green3 = background:linear-gradient(to bottom, #ddffcc 0%, #669955 90%) !important;
|blau3|blue3 = background:linear-gradient(to bottom, #ebecf8 0%, #4c55c3 90%) !important;
}}" role="button" title="{{{title|{{{Titel|{{FULLPAGENAME:{{{link|{{{1|Main page}}}}}}}}}}}}}}"><!--
--><span style="display:table;padding:{{{padding|0.25em 0.5em}}};"><!--
-->{{#if:{{{icon|}}}|<span class="ui-icon ui-icon-{{{icon}}}" style="display:table-cell;vertical-align:middle;"> </span>}}<!--
-->{{#if:{{{image|{{{Bild|}}}}}}|<span style="display:table-cell;vertical-align:middle;">{{#invoke:FileUtil|replaceParameter|1={{{image|{{{Bild|}}}}}}|2=link|3=}}</span>}}<!--
--><span style="display:table-cell;vertical-align:middle;line-height:1.4;{{#if:{{{icon|}}}{{{image|{{{Bild|}}}}}}|text-align:left;padding-left:0.25em;}}">{{{text|{{{2|Button}}}}}}</span><!--
--></span></span>]</span></onlyinclude>
{{documentation}}
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
3a0bedd327ba497aabd5a1b53cca82626c092a56
Template:Autotranslate
10
30
76
75
2022-01-07T08:25:21Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Autotranslate|autotranslate}}<!--
-->{{#ifeq: {{FULLPAGENAME}} |Template:{{{base|}}} |[[Category:Autotranslated templates|{{PAGENAME}}]]}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ab72c137619109cd8dab90f289c49eadb1a79b53
Template:BCP47
10
31
78
77
2022-01-07T08:25:22Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{lc:{{{1|}}}}}
<!-- pseudo codes -->
||root|default|i-default=<!-- empty language tag means unknown per the HTML spec --><!-- or ={{int:lang}}? (the best user default), or =en? (the default "ContentLanguage" for unlocalized data on Meta) -->
<!-- current BCP47 violations by Wikimedia sites, which can be fixed using standard tags when they exist -->
|als=gsw
|bat-smg=sgs
|de-formal=de<!-- could be "de-x-formal", but actually a subset within standard "de" for HTML/XML -->
|eml=egl<!-- retired code, the de facto eml.wikipedia uses Emilian, not Romagnol -->
|fiu-vro=vro
|mo=ro-cyrl<!-- retired, best fit on Wikimedia sites, but no longer working in interwikis (Wikipedia project deleted) -->
|nl-informal=nl<!-- could be "nl-x-informal", but actually a subset within standard "nl" for HTML/XML -->
|nrm=nrf<!-- Wikimedia sites uses "nrm" to mean Norman, but standard "nrm" is an unrelated language. The "nrf" code is now standardized for Norman (previously used a private-use extension of French "fr-x-nrm") -->
|roa-rup=rup
|simple=en<!-- could be "en-simple" but actually a subset within standard "en" for HTML -->
|sr-ec=sr-cyrl
|sr-el=sr-latn
|zh-classical=lzh
<!-- other current BCP47 violations by Wikimedia sites, fixed using private-use extensions (if they are needed, labels are limited to 8 letters/digits) -->
|cbk-zam=cbk-x-zam
|map-bms=jv-x-bms
|roa-tara=it-x-tara
|tokipona|tp=x-tokipona
<!-- conforming BCP47 "private-use" extensions used by Wikimedia, which are no longer needed, and improved using now standard codes -->
|be-x-old=be-tarask
<!-- conforming but ambiguous BCP47 codes used by Wikimedia in a more restrictive way, with more precision -->
|arc=syc<!-- The de-facto arc.wikipedia.org, as per their community request, is in actual using Syriac which is coded as syc -->
|no=nb<!-- "no" means Bokmål on Wikimedia sites, "nb" is not used -->
|bh=bho<!-- "bh"="bih" is a language family, interpreted in Wikimedia as the single language "bho", even if its interwiki code remains bh) -->
|tgl=tl-tglg<!-- "tgl" on Wikimedia is the historic variant of the Tagalog macrolanguage ("tl" or "tgl", "tl" recommended for BCP47), written in the Baybayin script ("tglg") -->
<!-- conforming BCP47 "inherited" tags, strongly discouraged and replaced by their recommended tags (complete list that should not be augmented now) -->
|art-lojban=jbo<!-- still used in some old Wikimedia templates -->
|en-gb-oed=en-gb<!-- no preferred replacement, could be "en-gb-x-oed" but actually a subset within standard "en-gb" -->
|i-ami=ami
|i-bnn=bnn
|i-hak=hak
|i-klingon=tlh
|i-lux=lb
|i-navajo=nv
|i-pwn=pwn
|i-tao=tao
|i-tay=tay
|i-tsu=tstu
|no-bok=nb<!-- still used in some old Wikimedia templates -->
|no-nyn=nn<!-- still used in some old Wikimedia templates -->
|sgn-be-fr=sfb
|sgn-be-nl=vgt
|sgn-ch-de=sgg
|zh-guoyu=cmn<!-- this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-hakka=hak
|zh-min=zh-tw<!-- no preferred replacement, could be "zh-x-min", but actually a subset within standard "zh-tw"; not necessarily "nan" -->
|zh-min-nan=nan<!-- used in some old Wikimedia templates and in interwikis -->
|zh-xiang=hsn
<!-- conforming BCP47 "redundant" tags, discouraged and replaced by their recommended tags (complete list that should not be augmented now) -->
|sgn-br=bzs
|sgn-co=csn
|sgn-de=gsg
|sgn-dk=dsl
|sgn-es=ssp
|sgn-fr=fsl<!-- still used in some old Wikimedia templates -->
|sgn-gb=bfi
|sgn-gr=gss
|sgn-ie=isg
|sgn-it=ise
|sgn-jp=jsl
|sgn-mx=mfs
|sgn-ni=ncs
|sgn-nl=dse
|sgn-no=nsl
|sgn-pt=psr
|sgn-se=swl
|sgn-us=ase<!-- still used in some old Wikimedia templates -->
|sgn-za=sfs
|zh-cmn=cmn<!-- still used in some old Wikimedia templates, this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-cmn-Hans=cmn-hans<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hans" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-cmn-Hant=cmn-hant<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hant" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin -->
|zh-gan=gan<!-- still used in some old Wikimedia templates -->
|zh-wuu=wuu<!-- still used in some old Wikimedia templates -->
|zh-yue=yue<!-- still used in some old Wikimedia templates and in interwikis -->
<!-- other "inherited" tags of the standard, strongly discouraged as they are deleted, but with no defined replacement there are left unaffected (complete list that should not be augmented now)-->
|cel-gaulish=xtg<!--ambiguous, most often "xtg" for Transalpine Gaulish in today's France, may also be "xcg" for Cisalpine Gaulish in today's Northern Italy-->
|i-enochian=x-enochian?
|i-mingo=x-mingo?
<!-- other standard "redundant" tags, which were unnecessarily registered (they validate with standard subtags) and that are left unaffected (complete list that should not be augmented now)
|az-arab
|az-cyrl
|az-latn
|be-latn
|bs-cyrl
|bs-latn
|de-1901
|de-1996
|de-at-1901
|de-at-1996
|de-ch-1901
|de-ch-1996
|de-de-1901
|de-de-1996
|en-boont
|en-scouse
|iu-cans
|iu-latn
|mn-cyrl
|mn-mong
|sl-nedis
|sl-rozaj
|sr-cyrl
|sr-latn
|tg-arab
|tg-cyrl
|uz-cyrl
|uz-latn
|yi-latn
|zh-hans
|zh-hans-cn
|zh-hans-hk
|zh-hans-mo
|zh-hans-sg
|zh-hans-tw
|zh-hant
|zh-hant-cn
|zh-hant-hk
|zh-hant-mo
|zh-hant-sg
|zh-hant-tw
--- standard special codes
|mul
|und
--- all other unaffected tags:
Minimal check of validity (valid BCP47 codes are necessarily stable over URLENCODE and #titleparts).
The check ensures that the code contains only ASCII letters, digits or hyphens, and starts by a letter.
This check is necessary to avoid a severe bug in MediaWiki, with some values of parameter 1, notably with
urlencoded characters (including quotes, braces, ampersands...), slashes, or any HTML or wiki formatting
(see also [[Template:CURRENTCONTENTLANGUAGE]]). If successful, force result to lowercase; otherwise
return an empty language tag.
-->
|#default =
{{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}}
| {{#ifeq: {{lc:{{#titleparts:{{{1|}}}|1}}}} | {{ucfirst:{{lc:{{#titleparts:{{{1|}}}|1}}}}}}
|
| {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}}
| {{lc:{{{1|}}}}}
}}
}}
}}
}}<noinclude>{{Documentation}}</noinclude>
c8d624bc6118b4a7d84d16636cf616ce4c2df56f
Template:Clickable button/doc
10
32
80
79
2022-01-07T08:25:22Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{tracked|T39744}}
{{TemplateBox
|1=target
|1d=The target page of the "button". For external links, however, it is recommended using the named parameter target. Please use named parameters if it is an external link because they often contain <code><nowiki>=</nowiki></code> which would confuse the parser.
|1def=
|1stat=required
|1aliases=1
|3=text
|3d=Text (caption) the button should carry. Either you specify text or an icon.
|3def=
|3stat=required
|3aliases=2
|5=external
|5d=Is this an external link? If it is, set to yes or aye, or whatever you like, except nothing.
|5def=
|5stat=optional
|5aliases=3
|7=iconPrimary
|7d=A jquery UI icon class for the primary icon (in LTR languages on the left side of the button label/text). E.g. ''ui-icon-gear''[http://api.jqueryui.com/theming/icons/]
|7def=
|7stat=optional-
|7aliases=4
|9=iconSecondary
|9d=A jquery UI icon class for the secondary icon (in LTR languages on the right side of the button label/text). E.g. ''ui-icon-triangle-1-s''
|9def=
|9stat=optional-
|9aliases=5
|11=class
|11d=Add classes like <code> ui-button-green ui-button-large</code>
|11def=
|11stat=optional-
|13=id
|13d=Unique id to be used as the button's ID-Attribute. Useful for JavaScript-binding and CSS-styling.
|13def=
|13stat=optional-
|name=Clickable button
|desc=Provides a button with hover effects.
|namespace=all
|usergroup=all
|placement=
|usage-notes=
----
:<code><nowiki>{{Clickable button|FAQ|Frequently asked questions}}</nowiki></code> →
::: {{Clickable button|FAQ|Frequently asked questions}}
----
: <code><nowiki>{{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}</nowiki></code> →
::: {{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}
----
: <code><nowiki>{{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}</nowiki></code> →
::: {{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}
----
: <code><nowiki>{{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}</nowiki></code> →
::: {{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}
----
: <code><nowiki>{{Clickable button|target={{fullurl:Special:Random/User talk|action=edit§ion=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}</nowiki></code> →
::: {{Clickable button|target={{fullurl:Special:Random/User talk|action=edit§ion=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}
|type=formatting
|example=
|i18n-method=-
|i18n-desc=
|seealso=
* {{tl|button}} (works without JS enabled)
* {{tl|Clickable button 2}} (import from de.wikipedia)
* {{tl|key press}}
* {{tl|Clickable button 3}}
|setscats=
|lines=1
|shorthand=
|relieson=
* [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=tree;f=resources/jquery.ui jquery.ui.button]
}}
== Test suite/ Unit tests ==
<table>
<tr><td>Icon only</td><td>{{Clickable button|iconPrimary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info}}</td></tr>
<tr><td>Icon text</td><td>{{Clickable button|iconPrimary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info|text=Abc}}</td></tr>
<tr><td>Text only, links</td><td>{{Clickable button|text=Abc}}</td><td>{{Clickable button|text=Abc|target=Main Page}}</td><td>{{Clickable button|text=Abc|target=//commons.wikimedia.org/wiki/Main_Page|external=1}}</td></tr>
<tr><td>Colors</td><td>{{Clickable button|text=Abc|class=ui-button-green}}</td><td>{{Clickable button|text=Abc|class=ui-button-red}}</td><td>{{Clickable button|text=Abc|class=ui-button-blue}}</td></tr>
</table>
<includeonly>
<!-- Interwikis go on Wikidata, please add only Categories here -->
[[Category:Formatting templates]]
</includeonly>
4cc3aaa3f6a8c5082a0131dcc282df65b98730a7
Template:Clickable button/iconclass
10
33
82
81
2022-01-07T08:25:23Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{{3|}}}
|<!-- a text was specified
-->{{#if:{{{1|}}}
|<!-- a primary icon was specified -->{{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-text-icons
|<!-- no secondary icon was specified --> ui-button-text-icon-primary
}}
|<!-- no primary icon specified --> {{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-text-icon-secondary
|<!-- no secondary icon was specified --> ui-button-text-only
}}
}}
|<!-- no text was specified
-->{{#if:{{{1|}}}
|<!-- a primary icon was specified -->{{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-icons-only
|<!-- no secondary icon was specified --> ui-button-icon-only
}}
|<!-- no primary icon specified --> {{#if:{{{2|}}}
|<!-- a secondary icon was specified --> ui-button-icon-only
|<!-- no secondary icon was specified --> error
}}
}}
}}
b7e75e0febaea1235889d2f960296c3d7149777a
Template:Dir
10
34
84
83
2022-01-07T08:25:23Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{{1}}}|aeb|aeb-arab|ar|arc|arq|ary|arz|azb|bcc|bgn|bqi|ckb|dv|fa|fa-af|glk|ha-arab|he|khw|kk-arab|kk-cn|ks|ks-arab|ku-arab|lki|lrc|luz|ms-arab|mzn|nqo|ota|pnb|prd|ps|sd|sdh|skr|skr-arab|ug|ug-arab|ur|uz-arab|ydd|yi={{{2|rtl}}}|{{{3|ltr}}}}}<noinclude>
{{Documentation}}
</noinclude>
df6edd972399033f616fa661a1879888642907cd
Template:Documentation
10
35
86
85
2022-01-07T08:25:24Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<!-- {{#invoke:Autotranslate|autotranslate}} is used to avoid "Warning: This page calls Template:Autotranslate which causes a template loop (an infinite recursive call). "-->
<onlyinclude>{{#invoke:Autotranslate|autotranslate
| base = Template:Documentation/i18n
|lang = {{{lang|{{int:Lang}} }}}
|1 = {{#if:{{{1|}}}
|{{{1}}}
|{{#ifexist:{{SUBJECTPAGENAME}}/doc
|{{SUBJECTPAGENAME}}/doc
|{{#ifexist:{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{SUBJECTPAGENAME}}/doc
}}
}}
}}
|2 = {{{heading|{{{2|}}} }}}
|content = {{{content|}}}
}}</onlyinclude>
7ad33c9fa0ba8f527d5f6f881ab8ab02837d7e17
Template:Documentation/i18n/en
10
36
88
87
2022-01-07T08:25:25Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{Documentation/layout
| lang = {{{lang|{{#invoke:Caller title|lang|base=Template:Documentation/i18n}}}}}
<!-- {{Documentation}} parameters: -->
|1={{{1|}}}
|heading={{{heading|{{{2|}}}}}}
|content={{{content|}}}
<!-- $1 is automatically replaced by [[Template:Documentation/layout]] using {{tmpl}} -->
| text = This documentation is [[w:Wikipedia:Transclusion|transcluded]] from $1.
<!-- DEPRECATED - New translations for these messages go in [[Data:I18n/Documentation.tab]]: -->
|edit=edit
|history=history
|view=view
|documentation=Documentation
}}</onlyinclude>
{{translated tag|documentation}}
359e436ac422fc11735fb22bcc4b900b77fd5423
Template:Documentation/layout
10
37
90
89
2022-01-07T08:25:27Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<div id="template-documentation" class="template-documentation"><templatestyles src="Template:Documentation/styles.css" /><!--
-->{{#if: {{PROTECTIONLEVEL:edit}} | {{Protected}} }}<!--
-->{{#ifeq: {{{heading|}}} | false |
| <div class="template-documentation-heading mw-content-{{dir|{{{lang|}}}}}" lang="{{{lang|}}}" dir="{{dir|{{{lang|}}}}}"><!--
--><span class="template-documentation-title">{{#if: {{{heading|}}}
| {{{heading|}}}
| [[File:Test Template Info-Icon.svg|50px|link=|alt=]] {{#switch:{{NAMESPACENUMBER}}
| 6 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|file-namespace-heading|fallback={{{documentation|}}}}}
| 10 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|template-namespace-heading|fallback={{{documentation|}}}}}
| 828 = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|module-namespace-heading|fallback={{{documentation|}}}}}
| #default = {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|other-namespaces-heading|fallback={{{documentation|}}}}}
}}
}}</span><span class="mw-editsection-like plainlinks" id="doc_editlinks"><!--
-->[ {{#if:{{{content|}}}||{{#ifexist:{{transclude|{{{1|{{DocPageName}}}}}}}|<!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|view-link-display|fallback={{{view|}}}}}] '''·''' <!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=edit}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|edit-link-display|fallback={{{edit|}}}}}] '''·''' <!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=history}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|history-link-display|fallback={{{history|}}}}}] '''·''' <!--
--><nowiki/>|<!--
-->[{{fullurl:{{transclude|{{{1|{{DocPageName}}}}}}}|action=edit&preload=Template:Documentation/preload}} {{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|create-link-display}}] '''·''' <!--
--><nowiki/>}}}}<!--
-->[{{fullurl:{{FULLPAGENAME}}|action=purge}} {{#invoke:TNTFallback|msg|lang={{{lang|{{int:lang}}}}}|I18n/Documentation.tab|purge-link-display|fallback={{{purge|}}}}}]<!--
--> ]</span></div>
}}
{{#if: {{{content|}}}
| <!-- do not show notice when /doc is not transcluded-->
<div class="template-documentation-content" lang="" dir="auto">
{{{content|}}}
</div>
| <div class="template-documentation-transcludedfrom mw-content-{{dir|{{{lang|}}}}}" lang="{{{lang|}}}" dir="{{dir|{{{lang|}}}}}">{{tmpl<!--
-->|0={{{text|(text: $1) — {{error|parameter text is not translated in [[Template:Documentation]]}}}}}<!--
-->|1=[[{{transclude|{{{1|{{DocPageName}}}}}}}]]<!--
-->}}</div>
<div class="template-documentation-content" lang="" dir="auto">
{{ {{{1|{{DocPageName}}}}} }}
</div>
}}
</div><noinclude>
{{#ifeq: {{SUBPAGENAME}} | sandbox | [[Category:Sandbox templates]] }}
[[Category:Layout templates]]
</noinclude>
d4416a7946916c152eaba1f50d7dbe50e60cfd1b
Template:Documentation/styles.css
10
38
92
91
2022-01-07T08:25:28Z
TheSink
2
1 revision imported
text
text/plain
.template-documentation {
margin-top: 1em;
clear: both;
border: 2px dotted #666;
padding: 0.6em;
background-color: #ecfcf4;
}
.template-documentation:after {
content: "";
display: block;
clear: both;
}
.template-documentation-heading {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.template-documentation-title {
font-size: 150%;
}
.template-documentation-transcludedfrom {
font-size: smaller;
font-style: italic;
}
937a4c089853e87d6903631231b1de77089e938a
Template:Documentation subpage
10
39
94
93
2022-01-07T08:25:28Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{SUBPAGENAME}}|{{#ifeq:{{{1|}}}|override|{{SUBPAGENAME}}|doc}}|</includeonly><!-- show on doc pages only
-->{{#invoke:Autotranslate | autotranslate
|base = Documentation subpage
|lang = {{{lang|}}}
|page = {{#if:{{{page|}}}|{{{page|}}}|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}
}}<!--
--><includeonly>{{{category|[[Category:{{#switch:{{SUBJECTSPACE}}
| Template = Template
| Module = Module
| User = User
| #default = Template
}} documentation|{{PAGENAME}}]]__EXPECTED_UNCONNECTED_PAGE__}}}</includeonly><!--
--><includeonly>}}</includeonly><!-- show on doc pages only
--><noinclude>{{documentation}}</noinclude>
783c674f03e3009e9b9ddc1cfd632a593534f7c6
Template:Namespace
10
40
96
95
2022-01-07T08:25:29Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{NAMESPACE:{{{1|{{FULLPAGENAME}}}}}}}
| {{ns:0}}=gallery
| {{ns:2}}=user page
| {{ns:4}}=project page
| {{ns:6}}=media file
| {{ns:8}}=system message
| {{ns:10}}=template
| {{ns:14}}=category
| {{TALKSPACE}}=talk page
| page}}<noinclude>
{{documentation}}
[[Category:Function templates|{{PAGENAME}}]]
</noinclude>
87365f1ed043eac399b5779a98e7dfa958df56a3
Template:Protected
10
41
98
97
2022-01-07T08:25:30Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{{demo-edit|{{PROTECTIONLEVEL:edit}}}}}
| sysop=
{{#ifeq:{{{icon}}}|no||<indicator name="protected">[[File:Full-protection-shackle-block.svg|20px|link=Special:MyLanguage/Commons:Protection policy|{{{{tSwitch|protected/text}}|img-text1}}]]</indicator>}}
<table class="protected" style="direction: {{dir|{{int:Lang}}}}; background:#fff; border:1px solid #aaa; padding:.2em; margin:.5em auto;">
<tr>
<td style="padding-right:4px; padding-left:4px;">[[File:Full-protection-shackle-block.svg|40px|link=COM:P|Protected]]</td>
<td>'''{{{{tSwitch|protected/text}}|text1}} {{#if:{{{1|}}}|{{{{tSwitch|protected/text}}|reason|reason={{{1}}}}}|{{{{tSwitch|protected/text}}|default-reason}}}}'''<br /><span style="font-size:90%;">{{{note|{{{{tSwitch|protected/text}}|text2}} }}}</span></td>
</tr>
</table>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|{{#switch:{{NAMESPACE}}|{{ns:6}}=[[Category:Protected files]]|{{ns:2}}|{{ns:3}}|{{ns:10}}=|[[Category:Protected pages]]}} }}} }}
| templateeditor=
<indicator name="protected">[[File:Template-protection-shackle-brackets 2.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text1}}]]</indicator>
| autoconfirmed=
<indicator name="protected">[[File:Semi-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text2}}]]</indicator>
| #default=
{{#ifeq:{{NAMESPACE}}|{{{demo-ns|{{ns:6}}}}}
| {{#switch:{{{demo-upload|{{PROTECTIONLEVEL:upload}}}}}
| sysop=
<indicator name="protected">[[File:Upload-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text3}}]]</indicator>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Upload protected files]]}}} }}
| autoconfirmed=
<indicator name="protected">[[File:Semi-protection-shackle.svg|20px|link=Special:MyLanguage/Commons:Protection policy||{{{{tSwitch|protected/text}}|img-text4}}]]</indicator>
| #default={{ifsandbox||
<div class="error">{{{{tSwitch|protected/text}}|error-text}}</div>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Unprotected pages using protection templates]]}}} }}}}
}}
|{{ifsandbox||<div class="error">{{{{tSwitch|protected/text}}|error-text}}</div>{{#if:{{{demo-edit|}}}{{{demo-upload|}}}||{{{category|[[Category:Unprotected pages using protection templates]]}}} }}}}
}}
}}<noinclude>
{{documentation}}
</noinclude>
bdc1d224afd2702accce70992774468ea129c15b
Template:Protected/text/en
10
42
100
99
2022-01-07T08:25:30Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<languages />
<onlyinclude>{{#switch:{{{1}}}
|text1=This {{namespace}} has been protected
|default-reason=from editing to prevent vandalism.
|reason=because {{{reason}}}.
|text2=Please discuss changes on the [[{{TALKPAGENAME}}|talk page]] or [[COM:AN/P|request unprotection]].
|img-text1=This page is protected against editing.
|img-text2=This page is semi-protected against editing.
|img-text3=This page is protected against reuploading.
|img-text4=This page is semi-protected against reuploading.
|img-text5=This page is template protected against editing.
|error-text=Error: This page is not currently protected. Please [[COM:AN/P|request protection]] or remove the protection template.
}}</onlyinclude>
{{translated tag|protection}}
57a0149cabd41c652f4b355a09433e45c076cf8c
Template:T/main
10
43
102
101
2022-01-07T08:25:31Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{code}}}}}|tt|<code>}}<!-- code start
-->{{#switch:{{#switch:{{{link}}}|no|n|-=1|0}}{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}{{#switch:-|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}<!--
-->|000|010|011|100=|{{#switch:{{{case}}}|i|n={{i18n/namespace|t|link={{{case}}}o|lang={{{i18n|}}}}}|l=template|Template}}:}}<!--
-->{{#switch:{{{link}}}|no|n={{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace;{{{style|}}}">}}<!-- link=no
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6={{}}<!--
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- when "link=no": just display
-->{{#if:{{{parm|}}}||{{{parm}}}}}<!-- optional parm display
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6=}}}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!--
-->|{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- when +: not outside
-->[[:{{#switch:{{{3|}}}|+|-|=|{{trim|{{{3}}}}}:}}<!-- language code (ISO 639-1) (and/or sisterproject prefix)
-->Template:{{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|<!-- =link=
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{case}}}|i|n={{i18n/namespace|t|link=no|lang={{{i18n|}}}}}|l=template|Template}}:}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace,monospace;{{{style|}}}">}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6={{|1|5={}}<!--
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- inside
-->{{#if:{{{code|}}}|<code>}}{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=<tt>}}<!-- code/typewrite start
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- display name
-->{{#if:{{{parm|}}}|{{#switch:||{{padleft:|1|{{{parm}}}}}|{{padleft:|6|{{{parm}}}}}=||}}{{{parm}}}}}<!-- opt. parm
-->{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=</tt>}}{{#if:{{{code|}}}|</code>}}<!-- typewrite/code end
-->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6=}}|1|5=}}}<!--
-->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!--
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}<!-- inside
-->]]{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}}}<!-- not outside
-->{{#ifeq:{{lc:{{{code}}}}}|tt|</code>}}<!-- code end
-->{{#if:{{{full|{{#ifeq:{{{5}}}|full|1}}}}}|<span class="plainlinks"><!--
--> <tt>(</tt><small>[{{fullurl:Template:{{{1|{{PAGENAME}}}}}}} {{int:view}}]<!--
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=edit}} {{int:edit}}]<!--
--> • [[:Template talk:{{{1|{{PAGENAME}}}}}|{{int:talk}}]]<!--
--> • [{{fullurl:Special:Whatlinkshere/Template:{{{1|{{PAGENAME}}}}}|limit=500}} Links]<!-- {{int:links}} needs fix
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=history}} History]</small><tt>)</tt><!--
--></span>}}<!--
--><noinclude>
{{documentation|Template:T/doc}}
</noinclude>
e60371a4d777e70155110efe1ec652cd23c183f6
Template:TSwitch
10
44
104
103
2022-01-07T08:25:32Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{{1}}}/{{#ifexist:Template:{{{1}}}/{{int:lang}}|{{int:lang}}|{{CONTENTLANG}}}}<noinclude>
{{documentation}}
[[Category:Internationalization templates]]
</noinclude>
873e12d3ffbcd17e722d71b4a538192b7ede5dbc
Template:Tag
10
45
106
105
2022-01-07T08:25:32Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{{plain|}}}|
|<code class="mw-highlight" style="{{#if:{{{wrap|}}}||white-space:nowrap}}">
}}{{#switch:{{{2|pair}}}
|c|close = <!--nothing-->
|s|single
|o|open
|p|pair = {{#tag:span|‎<|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#if:{{{params|}}}| {{{params}}}}}
}}{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|s|single =  {{#tag:span|/>|class="p"}}
|o|open = {{#tag:span|>|class="p"}}{{{content|}}}
|p|pair = {{#tag:span|>|class="p"}}{{{content|...}}}
}}{{#switch:{{{2|pair}}}
|s|single
|o|open = <!--nothing-->
|c|close
|p|pair = {{#tag:span|‎</|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#tag:span|>|class="p"}}
}}{{#if:{{{plain|}}}|
|</code>
}}<noinclude>
{{Documentation}}
</noinclude>
88657ad7afd7844d9681f7f08ba60c75c25800a1
Template:TemplateBox
10
46
108
107
2022-01-07T08:25:33Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Languages|autolang|base=TemplateBox/i18n
|useargs=both
|templateData={{#invoke:TemplateBox|templatedata}}
|JSONFM={{#invoke:TemplateBox|templatedata|formatting=pretty}}
|paramTable={{#invoke:TemplateBox|paramtable}}
|usageSample={{#invoke:TemplateBox|usagesample}}
|argCount={{#invoke:TemplateBox|argcount}}
|desc={{#invoke:TemplateBox|description}}
|templateDataInfo={{TemplateDataInfo/toggler}}
|i18n-subpage={{#ifeq:{{{i18n-subpage|}}}|.
| Template:{{{name|{{BASEPAGENAME}}}}}
| Template:{{{name|{{BASEPAGENAME}}}}}/{{{i18n-subpage|i18n}}}
}}
|usergroup={{lc:{{{usergroup|}}}}}
|name={{{name|{{BASEPAGENAME}}}}}
}}__NOEDITSECTION__<!--
Auto-categorization by internationalisation approach
-->{{#ifeq:{{SUBPAGENAME}}|doc
| <!--Don't categorize documentation subpages-->
| {{#ifeq:{{NAMESPACE}}|Template
| {{#switch:{{{i18n-method|}}}
|autotranslate=[[Category:Templates using Autotranslate for internationalisation]]
|switch=[[Category:Templates using LangSwitch for internationalisation]]
|custommediawiki-msg=[[Category:Templates using local MediaWiki messages for internationalisation]]
|mediawiki-msg=[[Category:Templates using MediaWiki messages from translatewiki.net for internationalisation]]
|ext.translate=[[Category:Templates using the Translate extension for internationalisation]]
|TNT =[[Category:Templates using Module:TNT for internationalisation]]
|-=[[Category:Templates not requiring internationalization]]
|#default=[[Category:Templates using an unknown approach for internationalisation]]
}}
| <!--Don't categorise Creator templates-->
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
bb241ecce14f3e8112e01930bffb5533bf57a9ec
Template:TemplateBox/i18n/en
10
47
110
109
2022-01-07T08:25:33Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{TemplateBox/layout
|name={{{name|}}}|desc={{{desc|}}}|namespace={{{namespace|}}}|usergroup={{{usergroup|}}}|placement={{{placement|}}}|usage-notes={{{usage-notes|}}}|type={{{type|}}}|example={{{example|}}}|example2={{{example2|}}}|example-value={{{example-value|}}}|i18n-method={{{i18n-method|}}}|i18n-subpage={{{i18n-subpage|}}}|i18n-desc={{{i18n-desc|}}}|seealso={{{seealso|}}}|setscats={{{setscats|}}}|lines={{{lines|}}}|shorthand={{{shorthand|}}}|relieson={{{relieson|}}}|docsub-override={{{docsub-override|}}}|docsub-page={{{docsub-page|}}}|mustbesubst={{{mustbesubst|}}}|templateData={{{templateData|}}}|JSONFM={{{JSONFM|}}}|useTemplateData={{{useTemplateData|}}}|paramTable={{{paramTable|}}}|templateDataInfo={{{templateDataInfo|}}}|usageSample={{{usageSample|}}}|argCount={{{argCount|}}}
|msg-setscats=The template automatically sets the following categories:
|msg-nodesc=No description yet available.
|msg-languagedependant=<nowiki /><small><!-- Remove this comment and insert the translation of "This part of the documentation is only available in a limited number of languages." --></small>
|msg-usage=Usage
|msg-examples={{PLURAL:{{#expr:{{#if:{{{example|}}}|1|0}}+{{#if:{{{example2|}}}|1|0}}}}|Example|Examples}}
|msg-example-renders-as=renders as:
|msg-shorthand=Or use the shorthand <nowiki /><!--
Some translations removed from translation (T8-T18)
If you want to re-install them (because there is something wrong with the MediaWiki-messages
that are used and provided by TemplateData, here they are:
https://commons.wikimedia.org/w/index.php?title=Template:TemplateBox/i18n&oldid=102987719
-->
|msg-shorthand-params-possible=… parameters as described …
|msg-param-none=The template takes no parameters.
|msg-moreinfo=Additional information
|msg-localization=Localization
|msg-localization-instruct-switch=To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{Tlf|LangSwitch| }}" construct. It takes the form "<code>{{!}}xx= Your translation </code>" (<code>xx</code> being the {{W|List of ISO 639-1 codes|code}} of your language)
|msg-localization-instruct-autotranslate=This template is localized through {{tl|Autotranslate}}.
<!-- $1 is automatically replaced by [[Template:TemplateBox/layout]] using {{tmpl}} -->
|msg-localization-template-layout=The layout of the template can be found under $1.
|msg-localization-instruct-autotranslate-new=To add your language to the list of languages supported by this template, please copy the code of [[Template:{{{name|{{PAGENAME}}}}}/en]] (or any other language version you prefer to translate) and replace the text strings in there (the form below can be used to create a translation, the English version is preloaded in the edit box). Please change the parameter <code>lang</code> from <code>en</code> (or whatever language you are translating) to the [[:en:ISO 639-1|language code]] of your language.
|msg-localization-instruct-none=This template is not intended to be localized.
|msg-localization-instruct-custommediawiki-msg=This template is localized by utilizing custom MediaWiki namespace messages.
|msg-localization-instruct-mediawiki-msg=This template is localized by utilizing MediaWiki namespace messages. These can be [[translatewiki:{{#if:{{{i18n-mediawiki-msg|}}}|MediaWiki:{{{i18n-mediawiki-msg|}}}|Special:Translate/ext-wikimediamessages}}|translated at translatewiki.net]] ([[:translatewiki:Special:Translations/MediaWiki:{{#if:{{{i18n-mediawiki-msg|}}}|{{{i18n-mediawiki-msg|}}}|Wm-license-{{lc:{{BASEPAGENAME}}}}-text}}|current translations]]).
|msg-localization-ext-translate=This template makes use of {{tl|Autotranslate}} and [[:mw:Special:MyLanguage/Help:Extension:Translate|the translate extension]].
|msg-localization-instruct-ext-translate=Translate this template now!
|msg-localization-instruct-ext-translate-admin=Administrate translations.
| msg-localization-tnt = This template is localized using [[Module:TNT]].
<!-- $1 is automatically replaced by [[Template:TemplateBox/layout]] using {{tmpl}} -->
| msg-localization-instruct-tnt = These translations are stored in $1.
|msg-seealso={{int:Seealso}}
|msg-relieson=Relies on:
|msg-intendedusergroups=The template is intended to be used by the following user groups:
|msg-intendedusergroups-all=[[Commons:Users|all users]]
|msg-intendedusergroups-bot=[[{{int:Grouppage-bot}}|{{int:Group-bot}}]]
|msg-intendedusergroups-admin=[[{{int:Grouppage-sysop}}|{{int:Group-sysop}}]]
|msg-intendedusergroups-bureaucrat=[[{{int:Grouppage-bureaucrat}}|{{int:Group-bureaucrat}}]]
|msg-intendedusergroups-checkuser=[[{{int:Grouppage-checkuser}}|{{int:Group-checkuser}}]]
|msg-intendedusergroups-imagereviewer=[[{{int:Grouppage-Image-reviewer}}|{{int:Group-Image-reviewer}}]]
|msg-intendedusergroups-vrt=[[{{int:grouppage-vrt-permissions}}|{{int:group-vrt-permissions}}]]
|msg-intendedusergroups-autoconfirmed=[[{{int:Grouppage-autoconfirmed}}|{{int:Group-autoconfirmed}}]]
|msg-intendedusergroups-autopatrolled=[[{{int:Grouppage-autopatrolled}}|{{int:Group-autopatrolled}}]]
|msg-intendedusergroups-filemover=[[{{int:Grouppage-filemover}}|{{int:Group-filemover}}]]
|msg-intendedusergroups-oversight=[[{{int:Grouppage-oversight}}|{{int:Group-oversight}}]]
|msg-intendedusergroups-patroller=[[{{int:Grouppage-patroller}}|{{int:Group-patroller}}]]
|msg-intendedusergroups-rollbacker=[[{{int:Grouppage-rollbacker}}|{{int:Group-rollbacker}}]]
|msg-intendedusergroups-upwizcampeditors=[[{{int:Grouppage-upwizcampeditors}}|{{int:Group-upwizcampeditors}}]]
|msg-intendedusergroups-translationadmin=[[{{int:Grouppage-translationadmin}}|{{int:Group-translationadmin}}]]
|msg-intendedusergroups-steward=[[{{int:Grouppage-steward}}|{{int:Group-steward}}]]
|msg-intendedusergroups-templateeditor=[[{{int:Grouppage-templateeditor}}|{{int:Group-templateeditor}}]]
|msg-intendedusergroups-unspecified=no user group specified
|msg-intendednamespaces=The template is intended to be used in the following namespaces:
|msg-intendednamespaces-unknown=unknown
|msg-intendednamespaces-all=all namespaces
|msg-intendednamespaces-talks=all talk namespaces and noticeboards
|msg-intendednamespaces-contents=all content namespaces
|msg-intendednamespaces-0=the main or gallery namespace (unprefixed)
|msg-intendednamespaces-1=the Talk namespace for the main namespace
|msg-intendednamespaces-2=the User namespace
|msg-intendednamespaces-3=the User talk namespace
|msg-intendednamespaces-4=the Commons namespace
|msg-intendednamespaces-5=the Commons talk namespace
|msg-intendednamespaces-6=the File namespace
|msg-intendednamespaces-7=the File talk namespace
|msg-intendednamespaces-8=the MediaWiki namespace
|msg-intendednamespaces-9=the MediaWiki talk namespace
|msg-intendednamespaces-10=the Template namespace
|msg-intendednamespaces-11=the Template talk namespace
|msg-intendednamespaces-12=the Help namespace
|msg-intendednamespaces-13=the Help talk namespace
|msg-intendednamespaces-14=the Category namespace
|msg-intendednamespaces-15=the Category talk namespace
|msg-intendednamespaces-16=the Creator namespace
|msg-intendednamespaces-17=the Creator talk namespace
|msg-intendednamespaces-18=the Special namespace
|msg-intendednamespaces-default=no namespace specified
|msg-placement=Placement:
|msg-placement-top=At the top of the page
|msg-placement-bottom=At the bottom of the page
|msg-placement-licence=In the "{{int:wm-license-information-permission}}" parameter of the {{tl|Information}} template (or the respective parameter of similar templates) or in the "{{int:license-header}}" section
|msg-placement-source=In the "{{int:wm-license-information-source}}" parameter of the {{tl|Information}} template (or the respective parameter of similar templates) or just below this template
|lang={{#invoke:Caller title|lang|base=Template:TemplateBox/i18n}}
}}</onlyinclude>
{{translated tag|documentation}}
7e1b1185fddca394a27eedc669bdd2a619db2da5
Template:TemplateBox/layout
10
48
112
111
2022-01-07T08:25:34Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<templatestyles src="TemplateBox/styles.css" />
__NOEDITSECTION__
{{#ifeq:{{{useTemplateData|}}}|export
|== {{{msg-export|Export code}}} ==
{{#tag:pre|{{msgnw:Template:{{{name|}}}}}
<nowiki><noinclude><templatedata></nowiki>
{{{JSONFM}}}
<nowiki></templatedata>
</noinclude></nowiki>
}}
|{{Documentation subpage|{{#if: {{{docsub-override|}}} | override | }}|page={{{docsub-page|}}}}}
{{#if: {{{desc|}}} | {{{msg-languagedependant|}}}
<div class="templatebox-desc">
{{{desc}}}
</div> | {{{msg-nodesc|}}} }}{{#if: {{{setscats|}}} |<nowiki/>
{{{msg-setscats}}}
{{{setscats|}}}
}}
== {{{msg-usage|}}} ==
{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|-1}}|doc||{{#if:{{{mustbesubst|}}}|{{Must be substituted|page={{{name|}}}}}}}}}
<div class="templatebox-usagesample">
{{{usageSample|}}}
</div>{{#if: {{{shorthand|}}} |<nowiki/>
{{{msg-shorthand|}}}<kbd>{{#ifexist: Template:{{{shorthand|}}} | <nowiki>{{</nowiki>{{{shorthand}}}{{#ifeq:{{{argCount|}}}|0|<!-- nothing -->| {{!}}{{{msg-shorthand-params-possible|… parameters as described …}}}}}<nowiki>}}</nowiki> | {{{shorthand|}}}}}</kbd>
}}{{#if: {{{usage-notes|}}} |<nowiki/>
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{usage-notes}}}
</div>
}}{{#if: {{{paramTable|}}} |<nowiki/>
=== {{int:templatedata-doc-params}} ===
{{#ifeq:{{{useTemplateData|}}}|only||{{{paramTable}}}}}
|<nowiki/>
{{{msg-param-none|}}} }}
{{#if:{{{useTemplateData|}}}
|{{#ifeq:{{{useTemplateData|}}}|only||{{Collapse top|[[:mw:Special:MyLanguage/Extension:TemplateData|{{{msg-templatedata|Template data}}}]]}}}}
{{{templateDataInfo}}}
{{#tag: templatedata
| {{{templateData|}}}
}}
{{#ifeq:{{{useTemplateData|}}}|only||{{Collapse bottom}}}}
}}
=== {{{msg-moreinfo|}}} ===
{{{msg-intendednamespaces|}}}
{{#switch: {{{namespace|}}}
|={{{msg-intendednamespaces-default|}}}
|all={{{msg-intendednamespaces-all|}}}
|talks={{{msg-intendednamespaces-talks|}}}
|contents={{{msg-intendednamespaces-contents|}}}
|0|Main|Gallery|main|gallery={{{msg-intendednamespaces-0|}}}
|1|Talk|talk={{{msg-intendednamespaces-1|}}}
|2|User|user={{{msg-intendednamespaces-2|}}}
|3|User talk|user talk={{{msg-intendednamespaces-3|}}}
|4|Commons|commons={{{msg-intendednamespaces-4|}}}
|5|Commons talk|commons talk={{{msg-intendednamespaces-5|}}}
|6|File|file={{{msg-intendednamespaces-6|}}}
|7|File talk|file talk={{{msg-intendednamespaces-7|}}}
|8|MediaWiki|mediaWiki={{{msg-intendednamespaces-8|}}}
|9|MediaWiki talk|mediaWiki talk={{{msg-intendednamespaces-9|}}}
|10|Template|template={{{msg-intendednamespaces-10|}}}
|11|Template talk|template talk={{{msg-intendednamespaces-11|}}}
|12|Help|help={{{msg-intendednamespaces-12|}}}
|13|Help talk|help talk={{{msg-intendednamespaces-13|}}}
|14|Category|category={{{msg-intendednamespaces-14|}}}
|15|Category talk|category talk={{{msg-intendednamespaces-15|}}}
|16|Creator|creator={{{msg-intendednamespaces-16|}}}
|17|Creator talk|creator talk={{{msg-intendednamespaces-17|}}}
|18|Special|special={{{msg-intendednamespaces-18|}}}
|#default={{{msg-intendednamespaces-unknown|}}}
}}
{{{msg-intendedusergroups|}}}<!-- usergroup is always lower case transformation on [[Template:TemplateBox]] -->
{{#switch: {{{usergroup|}}}
|all={{{msg-intendedusergroups-all|}}}
|bot={{{msg-intendedusergroups-bot|}}}
|administrator|admin|sysop={{{msg-intendedusergroups-admin|}}}
|bureaucrat|crat={{{msg-intendedusergroups-bureaucrat|}}}
|checkuser={{{msg-intendedusergroups-checkuser|}}}
|licensereviewer|imagereviewer|image-reviewer|license-reviewer={{{msg-intendedusergroups-imagereviewer|}}}
|vrt|vrt-agent|otrs|otrs-agent|otrs-member={{{msg-intendedusergroups-vrt|}}}
|autoconfirmed={{{msg-intendedusergroups-autoconfirmed|}}}
|autopatrolled={{{msg-intendedusergroups-autopatrolled|}}}
|filemover={{{msg-intendedusergroups-filemover|}}}
|oversight={{{msg-intendedusergroups-oversight|}}}
|patroller={{{msg-intendedusergroups-patroller|}}}
|rollbacker={{{msg-intendedusergroups-rollbacker|}}}
|steward={{{msg-intendedusergroups-steward|}}}
|templateeditor|template editor={{{msg-intendedusergroups-templateeditor|}}}
|upwizcampeditors={{{msg-intendedusergroups-upwizcampeditors|}}}
|translationadmin|translateadmin={{{msg-intendedusergroups-translationadmin|}}}
|#default={{{msg-intendedusergroups-unspecified|}}}
}}{{#if: {{{placement|}}} |<nowiki/>
{{{msg-placement|}}}
{{#switch: {{{placement|}}}
|top={{{msg-placement-top|}}}
|bottom={{{msg-placement-bottom|}}}
|license|licence={{{msg-placement-licence|}}}
|source={{{msg-placement-source|}}}
|#default={{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{placement}}}
</div>
}}
}}{{#if: {{{relieson|}}} |<nowiki/>
{{{msg-relieson|}}}<br />
{{{relieson|}}}
}}{{#if: {{{example|}}}{{{example2|}}} |<nowiki/>
== {{{msg-examples}}} ==
<nowiki/>}}{{#if: {{{example|}}} |<nowiki/>
<nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example}}}<nowiki>}}</nowiki>
{{{msg-example-renders-as|}}}
<div class="templatebox-example">
{{#if:{{{example-value|}}}|{{{example-value}}}|{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example|}}}|category=}}}}
</div>
}}{{#if: {{{example2|}}} |<nowiki/>
{{#if: {{{example|}}}
|<hr class="templatebox-examples-separator"/>}}
<nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example2}}}<nowiki>}}</nowiki>
{{{msg-example-renders-as|}}}
<div class="templatebox-example">
{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example2|}}}|category=}}
</div>
}}{{#if: {{{seealso|}}} |<nowiki/>
== {{{msg-seealso|}}} ==
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{seealso}}}
</div>
}}{{#switch: {{{i18n-method|}}}
|-=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-none|}}}
|autotranslate=<nowiki/>
== {{{msg-localization|}}} ==
{{lang links|Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|suppressaddlink=true}}
{{{msg-localization-instruct-autotranslate}}}
{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
{{tmpl|0=
{{{msg-localization-template-layout}}}
|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
}}
}}
{{{msg-localization-instruct-autotranslate-new}}}
{{#tag:inputbox|
type=create
preload=Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}/en
default=Template:{{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}} }}/{{#ifexist: Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}/{{int:Lang}} | LANGCODE | {{int:Lang}} }}
}}
|ext.translate=<nowiki/>
== {{{msg-localization|}}} ==
{{lang links|suppressaddlink=true|1={{{i18n-subpage}}}}}
{{{msg-localization-ext-translate}}}
{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
{{tmpl|0=
{{{msg-localization-template-layout}}}
|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
}}
}}
<div style="text-align:center">{{Clickable button|target={{TranslateLink|{{{i18n-subpage}}}}}|text=[[File:Icono de traducción.svg|48px|link=]]'''{{{msg-localization-instruct-ext-translate}}}'''|class=ui-button-blue ui-button-large|external=true}}</div>
<div style="text-align:center">{{Clickable button|target={{fullurl:{{{i18n-subpage}}}|action=edit}}|text='''{{{msg-localization-instruct-ext-translate-admin}}}'''|class=ui-button-red ui-button-large|iconPrimary=ui-icon-wrench|external=true}}</div>
|switch=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-switch|}}}
|mediawiki-msg=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-mediawiki-msg|}}}
|custommediawiki-msg=<nowiki/>
== {{{msg-localization|}}} ==
{{{msg-localization-instruct-custommediawiki-msg|}}}
|TNT=<nowiki/>
<h2>{{{msg-localization}}}</h2>
{{{msg-localization-tnt}}}
{{tmpl|0=
{{{msg-localization-instruct-tnt}}}
|1=[[Data:{{#if:{{{i18n-data-file|}}}<!--
-->|{{#invoke:TNTTools|TNTTabFull|{{{i18n-data-file}}}}}<!--
-->|I18n/{{#if:{{{name|}}}|{{{name}}}|{{ROOTPAGENAME}}}}.tab<!--
-->}}]]
}}
|#default=
}}{{#if: {{{i18n-desc|}}} |<nowiki/>
{{{msg-languagedependant|}}}
<div class="templatebox-languagedependant">
{{{i18n-desc}}}
</div>
}}}}<noinclude>[[Category:Layout templates]]</noinclude>
ba24e9161173d0bcbff656777a54bd39d9f18046
Template:TemplateBox/styles.css
10
49
114
113
2022-01-07T08:25:34Z
TheSink
2
1 revision imported
text
text/plain
.templatebox-desc {
font-size: 1.2em;
font-weight: bolder;
padding: 0.2em;
text-shadow: 1px 1px 1px rgb(255, 255, 255);
}
.templatebox-usagesample {
background: white;
background: rgba(255, 255, 255, 0.9);
font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono',
'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace;
}
.templatebox-languagedependant {
background: rgba(255, 255, 255, 0.5);
padding: 0.2em;
}
.templatebox-example {
border: 1px solid black;
background-color: white;
width: 90%;
padding: 1.5em;
}
.templatebox-example:after {
display: block;
content: "";
clear: both;
}
hr.templatebox-examples-separator {
margin: 1em 0;
}
8ed2a78f01e66c149aa24c906458f66c0da13a5c
Template:TemplateDataInfo/i18n/en
10
50
116
115
2022-01-07T08:25:35Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<languages/>
<onlyinclude>{{TemplateDataInfo/layout
|title=TemplateData
|text=[[:mw:Special:MyLanguage/Extension:TemplateData|TemplateData]] is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by [[:mw:Special:MyLanguage/:VisualEditor|VisualEditor]] and possibly other tools like [[Special:MyLanguage/Commons:Upload Wizard|Upload Wizard]].
----
<u>Existing template documentation</u><br/>
At Wikimedia Commons, it is recommended to use {{tl|TemplateBox}} with either <code><nowiki>‎useTemplateData=1</nowiki></code> or <code><nowiki>‎useTemplateData=only</nowiki></code> on the <code><nowiki>‎/doc</nowiki></code> subpage and transcluding it with {{tl|Documentation}} into the template. {{tag|nowiki|o}}-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
<u>Newly created template documentation and imports</u><br/>
Another option, especially for imported templates, or for users with JSON experience, is placing raw {{tag|templatedata|o}}-tags into the Wikitext of the template, as described in various Wikipediae.
<u>Discussion</u><br/>
[[Commons:Requests for comment/How Commons should deal with TemplateData|There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.]]
|help=Wikipedia's help about TemplateData
|helppage=:en:Wikipedia:VisualEditor/TemplateData/Tutorial
|info=Commons-specific information
|lang={{#invoke:Caller title|lang|base=Template:TemplateDataInfo/i18n}}
}}</onlyinclude>
{{translated tag|header}}
a867573cd8ef62bdca5895c488ba206e3f221ac8
Template:TemplateDataInfo/layout
10
51
118
117
2022-01-07T08:25:35Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude><templatestyles src="Template:TemplateDataInfo/styles.css" /><div class="commons-template-TemplateDataInfo mw-content-{{dir|{{{lang|}}}}}" lang="{{BCP47|{{{lang|}}}}}" dir="{{dir|{{{lang|}}}}}">
<div class="header" lang="zxx" dir="ltr"><nowiki><templatedata>JSON</templatedata></nowiki> ./. {{tl|TemplateBox}}</div>
;{{{title}}}
{{{text}}}
----
[[{{{helppage|:en:Wikipedia:VisualEditor/TemplateData/Tutorial}}}|{{{help}}}]] • [[Special:MyLanguage/Commons:TemplateData|{{{info}}}]]
</div><includeonly>{{#ifeq:{{NAMESPACE}}:{{ROOTPAGENAME}}|Template:TemplateDataInfo|
|{{#switch:{{SUBPAGENAME}}
|#default=[[Category:Templates using TemplateData]]
|doc
|documentation
|metatemplatedoc
|templatedoc
= [[Category:TemplateData documentation]]
|sandbox=
|TemplateData={{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}
|[[Category:Templates using TemplateData]]
|[[Category:TemplateData documentation]]
}}
}}
}}</includeonly></onlyinclude>
[[Category:Layout templates]]
6945d2ce7eb7a3075e63cf2c64e09a7a9a4cd826
Template:TemplateDataInfo/styles.css
10
52
120
119
2022-01-07T08:25:36Z
TheSink
2
1 revision imported
text
text/plain
.commons-template-TemplateDataInfo {
background:
/* color: */ #FFEF8F
/* image: */ linear-gradient(to bottom, #FFF1A0 35%, #FFEF8F 58%)
/* repeat: */ repeat-x
/* position/size: */ top/1px 100px
;
border: 1px solid #f9dd34;
color: #363636;
padding: 0 .5em;
margin: .5em 0;
}
.commons-template-TemplateDataInfo .header {
font-size: 120%;
font-family: monospace, monospace;
}
.commons-template-TemplateDataInfo[dir="ltr"] .header {
/* @noflip */
float: right;
}
.commons-template-TemplateDataInfo[dir="rtl"] .header {
/* @noflip */
float: left;
}
b9968af3a612eebf95bc89613dc43b01dc442978
Template:TemplateDataInfo/toggler
10
53
122
121
2022-01-07T08:25:36Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude><div class="mw-collapsible mw-collapsed">
<div class="mw-collapsible-toggle" style="cursor:pointer" title="Information about TemplateData">{{Clickable button|iconPrimary=ui-icon-help|target={{FULLPAGENAME}}}}</div>
<div class="mw-collapsible-content">{{autotranslate|base=TemplateDataInfo/i18n}}</div>
</div></onlyinclude>
{{documentation}}
82b6f7e94fa413fec53c88bbc4cec13e66da4664
Template:Tl
10
54
124
123
2022-01-07T08:25:37Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<noinclude>{{protected template}}
</noinclude>{{T/main|{{{1|}}}
|{{{2|}}}
|{{{3|{{{lang|}}}}}}
|{{{4|}}}
|{{{5|}}}
|incl={{{incl|{{{i|3}}}}}}
|code={{{code|}}}
|link={{{link|}}}
|case={{{case|}}}
|i18n={{{i18n|}}}
|parm={{{parm|}}}
|full={{{full|}}}
|style={{{style|}}}
}}<noinclude>
{{documentation|Template:T/doc}}
</noinclude>
06c675ce6e24c57cb8f52ad7ad989aeda3525f57
Template:Tmpl
10
55
126
125
2022-01-07T08:25:38Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude><includeonly>{{#invoke:Tmpl|renderTmpl}}</includeonly></onlyinclude>
{{Documentation}}
d922467760bdc418abb5df1e8565ae09d322a8de
Template:Tracked
10
56
128
127
2022-01-07T08:25:38Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude>{{Tracked/layout
|1={{#if:{{{1|<noinclude>1</noinclude>}}}|
{{#ifeq:{{padleft:|1|{{uc:{{{1}}}}}}}|T
| {{uc:{{{1}}}}}<!-- Phab -->
| T{{#expr:{{{1|}}}+2000 }}<!-- Bugzilla -->
}}
}}
|2={{{2|}}}
|float={{{float|}}}
|style={{{style|}}}
}}</onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
77ceeeae108cc39044714f8d4245e1e1f476dc77
Template:Tracked/layout
10
57
130
129
2022-01-07T08:25:38Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude><templatestyles src="Template:Tracked/styles.css"
/><div class="tracked plainlinks {{#if:{{{1|}}}|mw-trackedTemplate}}" {{#if:{{{float|}}}{{{style|}}}|style="<!--
-->{{#if:{{{float|}}}|float:{{{float}}};clear:{{{float}}};}}<!--
-->{{{style|}}}<!--
-->"}}><!--
-->{{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|header-phabricator}}<br/><!--
-->{{#if:{{{1|<noinclude>1</noinclude>}}}|'''[[phabricator:{{{1|}}}|<span class="tracked-url trakfab-{{{1}}}">{{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|task|{{{1}}}}}</span>]]'''<br/>}}<!--
--><span class="{{trim|1=status {{#switch:{{lc:{{{2|}}}}}
|resolved|fixed=resolved
}}}}">{{#switch:{{lc:{{{2|}}}}}
|open={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-open}}
|resolved|fixed={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-resolved}}
|duplicate={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-duplicate}}
|stalled|later={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-stalled}}
|declined|wontfix={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-declined}}
|invalid={{#invoke:TNT|msg|lang={{{lang|{{int:lang}}}}}|I18n/Tracked.tab|status-invalid}}
}}</span></div></onlyinclude>
[[Category:Layout templates]]
2a2be2946d542a16fb6a4adfb4c04cf7eccd7860
Template:Tracked/styles.css
10
58
132
131
2022-01-07T08:25:38Z
TheSink
2
1 revision imported
text
text/plain
/**
* Styles for [[Template:Tracked]].
*/
.tracked {
float: right;
clear: right;
border: 1px solid #999;
border-radius: 0.5em;
background-color: #eee;
background-image: linear-gradient(to bottom, #ddd,#eee);
font-size: 85%;
text-align: center;
padding: 0.5em;
margin-left: 1em;
margin-bottom: 1em;
width: 12em;
color: black;
}
.tracked p {
margin: 0;
}
.tracked-url {
font-weight: bold;
}
/* status line */
.tracked .status,
.tracked-status {
font-weight: bold;
text-transform: uppercase;
}
.tracked .status.resolved,
.tracked-resolved {
color: green;
}
.tracked .status.critical,
.tracked-critical {
color: red;
font-size: 1.5em;
}
380e3497ad1559974c1965d32a486b9f188bf47c
Template:Transclude
10
59
134
133
2022-01-07T08:25:39Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch: {{NAMESPACE: {{{1}}} }}
|#default = {{FULLPAGENAME: {{{1}}} }} <!-- eg "User:Foo" -->
|{{ns:0}} =
{{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }}
| Template:{{{1}}} <!-- no leading colon, eg "Foo" -->
| {{PAGENAME: {{{1}}} }} <!-- leading colon, eg ":Foo", so we want the article -->
}}
}}<noinclude>
{{documentation}}
</noinclude>
d0239e71e5745cd0d4efd032cee07341e111376b
Template:Trim
10
60
136
135
2022-01-07T08:25:39Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#if:1|{{{1|}}}}}<noinclude>
{{documentation}}
[[Category:String manipulation templates]]
</noinclude>
5496baa4e911ad0126f59e72161d97f5d555bb5b
Module:Autotranslate
828
61
138
137
2022-01-07T08:25:40Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[[
__ __ _ _ _ _ _ _ _
| \/ | ___ __| |_ _| | ___ _ / \ _ _| |_ ___ | |_ _ __ __ _ _ __ ___| | __ _| |_ ___
| |\/| |/ _ \ / _` | | | | |/ _ (_) / _ \| | | | __/ _ \| __| '__/ _` | '_ \/ __| |/ _` | __/ _ \
| | | | (_) | (_| | |_| | | __/_ / ___ \ |_| | || (_) | |_| | | (_| | | | \__ \ | (_| | || __/
|_| |_|\___/ \__,_|\__,_|_|\___(_)_/ \_\__,_|\__\___/ \__|_| \__,_|_| |_|___/_|\__,_|\__\___|
Authors and maintainers:
* User:Zolo - original version
* User:Jarekt
]]
-- local function to help normalize input arguments
local function normalize_input_args(input_args, output_args)
for name, value in pairs( input_args ) do
if value ~= '' then -- nuke empty strings
if type(name)=='string' then name=string.lower(name) end -- convert to lower case
output_args[name] = value
end
end
return output_args
end
-- initialize object to be returned
local p = {}
--[[
autotranslate
This function is the core part of the Autotranslate template.
Usage from a template:
{{#invoke:autotranslate|autotranslate|base=|lang= }}
Parameters:
frame.args.base - base page name
frame.args.lang - desired language (often user's native language)
Error Handling:
]]
function p.autotranslate(frame)
-- switch to lowercase parameters to make them case independent
local args = {}
args = normalize_input_args(frame:getParent().args, args)
args = normalize_input_args(frame.args, args)
-- get language fallback list
if not args.lang or not mw.language.isSupportedLanguage(args.lang) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
local langList = mw.language.getFallbacksFor(args.lang)
table.insert(langList,1,args.lang)
-- find base page
local base = args.base
args.base = nil
assert(base and #base>0, 'Base page not provided for autotranslate' )
if not mw.ustring.find(base,':') then -- if base page does not indicate namespace
base = 'Template:' .. base -- than assume it is a template
end
-- find base template language subpage
local page = args.default -- default page if provided or nil otherwise
for _, language in ipairs(langList) do
if mw.title.new(base .. '/' .. language).exists then
page = base .. '/' .. language -- returns only the page
break
end
end
assert(page, string.format('No fallback page found for autotranslate (base=[[%s]], lang=%s)', base, args.lang))
-- Transclude {{page |....}} with template arguments the same as the ones passed to {{autotranslate}} template.
return frame:expandTemplate{ title = page, args = args}
end
return p
f1c4395dd1b0078b2e2f6d40b4320812c3567998
Module:Caller title
828
62
140
139
2022-01-07T08:25:41Z
TheSink
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.title(frame)
return frame:getParent():getTitle()
end
function p.lang(frame)
local base = frame.args.base
local title = p.title(frame)
if base ~= title then
local parts = mw.text.split(p.title(frame), '/', true)
return parts[#parts]
else
-- we’re on the base page of the translation (directly, it’s not translated from somewhere),
-- so we have no subpage language code, but we use PAGELANGUAGE
return frame:preprocess('{{PAGELANGUAGE}}')
end
end
return p
cda968cdcb51987e070fd2e22be310ef9b870974
Module:Languages
828
63
142
141
2022-01-07T08:25:42Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[=[
Not globally exposed. Internal function only.
language_subpages( frame, transform, options )
Parameters
frame: The frame that was passed to the method invoked. The first argument or the page argument will be respected.
transform: A transform function. Example: function( basepagename, subpagename, code, langname ) end
options: An object with options. Example: { abort= { on=function() end, time=0.8 } }
Following options are available:
abort: Aborts iterating over the subpages if one of the conditions is met. If the process is aborted, nil is returned!
on: Function to be called if an abort-condition was met.
cycles: The maximum number of subpages to run over.
time: Maximum time to spend running over the subpages.
]=]
function language_subpages( frame, transform, options )
local args, pargs, options = frame.args, ( frame:getParent() or {} ).args or {}, options or {};
local title = args.page or args[1] or pargs.page or pargs[1] or "";
local abort = options.abort or {};
local at, clock = type( abort.on ), os.clock();
local ac = function()
if at == 'function' or ( at == 'table' and getmetatable(abort.on).__call ) then
abort.on();
end
end
local tt = type( transform );
local page = require( 'Module:Page' );
title = page.clean(title);
if tt == 'function' or ( tt == 'table' and getmetatable(transform).__call ) then
local fetch, pages, langcode, langname = mw.language.fetchLanguageName, {};
--[==[
/ \
/ | \
/ · \
¯¯¯¯¯¯¯
Page.subpages() no longer works because it attempted to parse the HTML content generated by
calling the parser function "Special:Prefixindex:" which is no longer expanded in Lua but
converted to a "stripped tag" (containing a unique identifier surrounded by ASCII DEL characters)
representing the tag name and its parameters.
The actual expansion of stripped tags can no longer be performed in Lua.
Now unstripping these tags just kills ALL these tags (except "wiki" tags) instead of performing
their expansion by running the extension code. Only MediaWiki can unstrip these tags in texts after
they have been returned by Lua.
For this reason, page.subpages() is now completely empty (Module:Page no longer works).
This cannot be bypassed, except by using a Scribunto extension library if lifting the limits set by mw.unstrip.
Note that "Special:Prefixindex:" is also costly, even if it just requires a single database query to
get all subpages, instead of one costly #ifexist or one costly mw.title() property reading per
tested subpage to know if it exists.
For now there's still no reliable way to get a list of subpages, or performing queries similar to
the [[Special:Prefixindex]] page or list members of a category like when viewing a category page.
Ideally, there should exist a method for such queries on Title objects returned by the mw.title library;
but for now there's none.
In Lua now, the only expansion possible with an immediate effect is the expansion of standard templates,
all special tags or special pages, or parser function extensions do not work (Only the #expr parser
function is supported by using an external Scribunto library).
--]==]
for pg in page.subpages( title, { ignoreNS=true } ) do
if abort.cycles then
abort.cycles = abort.cycles - 1
if 0 == abort.cycles then return ac() end
end
if abort.time then
if (os.clock() - clock) > abort.time then return ac() end
end
if mw.ustring.len( pg ) <= 12 then
langcode = string.lower( pg );
langname = fetch( langcode );
if langname ~= '' then
table.insert( pages, transform( title, pg, langcode, langname ) );
end
end
end
return pages;
end
return {};
end
function cloneArgs(frame)
local args, pargs = {}, {}
for k,v in pairs( frame.args ) do args[k] = v end
if frame:getParent() then
for k,v in pairs( frame:getParent().args ) do pargs[k] = v end
end
return args, pargs
end
local p = {};
--[=[
Usage:
{{#invoke:languages|internal|Template:Adjective}}
]=]
function p.internal(frame)
return table.concat(
language_subpages( frame,
function( title, page, code, name )
return mw.ustring.format(
'<bdi class="language lang-%s" lang="%s">[[%s/%s|%s]]</bdi>',
code, code,
title, page,
name
);
end
),
' <b>·</b> '
);
end
--[=[
Usage:
{{#invoke:languages|external|Template:Adjective}}
]=]
function p.external(frame)
return table.concat(
language_subpages( frame,
function( title, page, code, name )
return mw.ustring.format(
'<bdi class="language lang-%s" lang="%s">[%s/%s %s]</bdi>',
code, code,
tostring( mw.uri.fullUrl( title ) ), page:gsub( ' ', '_' ),
name
);
end
),
' <b>·</b> '
);
end
--[=[
forEachLanguage
This function iterates over all language codes known to MediaWiki based on a maintained list
replacing patterns in a pattern-string for each language
Usage
{{#invoke:Languages|forEachLanguage
|pattern=patternstring
|before=string to insert before iteration
|after=string added after iteration
|sep=separator string between iterations
|inLang=langcode used for $lnTrP and $lnTrUC1
}}
Parameters
pattern: A pattern string which is processed for each language and which is concatenated at the end and returned as one string
before: A string that is inserted before the concatenated result
after: A string that is inserted after the concatenated result
sep: A string that is inserted between each line created from the pattern while iterating (like ProcessedPattern_sep_ProcessedPattern_sep_ProcessedPattern)
inLang: Langcode to use for $lnTrP and $lnTrUC1
preprocess: if set to a non-empty value, the output will be preprocessed before being returned.
Warning
The output is still not prepreprocessed by default: so parser functions and magic keywords generated by the pattern are still not executed and replaced,
and template transclusions are still not expanded (see examples in other functions in this module).
When using this function directly from a MediaWiki page or template, this means it is only possible to use patterns generating basic MediaWiki formatting
or HTML tags. It you want the output to be preprocessed (in the given frame), set the preprocess parameter to a non-empty string.
Patterns
$lc - language code such as en or de
$lnP - language name in own language (autonym)
$lnUC1 - language name in own language (autonym), first letter upper case
$lnTrP - language name translated to the language requested by language code passed to inLang
$lnTrUC1 - language name translated to the language requested by language code passed to inLang, first letter upper case
Example
{{#invoke:Languages|forEachLanguage|pattern=<span lang="$lc" xml:lang="$lc" class="language lang-$lc">[[Page/$lc|$lnP]]</span>}}
]=]
-- =p.forEachLanguage({ args= { pattern = "$lc - $lnTrP\n", inLang = "en" } })
function p.forEachLanguage(frame)
local l = require("Module:Languages/List")
local ret = {}
local lang = mw.language
local line
local pattern = frame.args.pattern or frame.args[1] or ""
local prefix = frame.args.before or frame.args[2] or ""
local postfix = frame.args.after or frame.args[3] or ""
local sep = frame.args.sep or frame.args.separator or frame.args[4] or ""
local inLang = frame.args.inLang or frame.args[5] or nil
local preprocess = frame.args.preprocess or frame.args[6] or ""
local langNameUCFirstReq = not not pattern:find( "$lnUC1", 1, true )
local langNameReq = not not pattern:find( "$lnP", 1, true ) or langNameUCFirstReq
local langNameTranslatedUCFirstReq = not not pattern:find( "$lnTrUC1", 1, true )
local langNameTranslatedReq = not not pattern:find( "$lnTrP", 1, true ) or langNameTranslatedUCFirstReq
local contentLangInstance = mw.language.getContentLanguage()
local inLangLangInstance
local l = mw.language.fetchLanguageNames() -- autonyms
local lTr
local lcIdList = require('Module:Languages/List').getSortedList( l )
if langNameTranslatedReq then
inLangLangInstance = --[==[
mw.getLanguage( inLang ) -- Quota hit in :ucfirst() if using too many langInstances
--]==] contentLangInstance
lTr = mw.language.fetchLanguageNames( inLang ) -- translated names
end
for _, lcId in pairs( lcIdList ) do
local subst = lcId:gsub('%%', '%%%%')
line = pattern:gsub( "%$lc", subst )
local langName, langInstance
-- autonym (name of lcId in locale lcId)
if langNameReq then
langName = l[lcId]
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnP", subst )
end
if langNameUCFirstReq then
langInstance = --[==[
mw.getLanguage( lcId ) -- Quota hit in :ucfirst() if using too many langInstances
--]==] contentLangInstance
langName = langInstance:ucfirst( langName )
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnUC1", subst )
end
-- translated name (name of lcId in locale inLang)
if langNameTranslatedReq then
langName = lTr[lcId]
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnTrP", subst )
end
if langNameTranslatedUCFirstReq then
langName = inLangLangInstance:ucfirst( langName )
subst = langName:gsub('%%', '%%%%')
line = line:gsub( "%$lnTrUC1", subst )
end
table.insert(ret, line)
end
ret = prefix .. table.concat( ret, sep ) .. postfix
if preprocess ~= '' then
ret = frame:preprocess(ret)
end
return ret
end
--[=[
Provide logic for [[Template:Lle]] (Language Links external, to be substituted, language names written exactly as #language would provide them)
Warning: may expands too many costly #ifexist without limitation (if not substituted into a separate "/lang" template)
]=]
function p.lle(frame)
return frame:preprocess(
p.forEachLanguage({
args = {
pattern = '{{subst:#ifexist:{{{1}}}/$lc|[{{subst:fullurl:{{{1}}}/$lc}} <bdi class="language lang-$lc" lang="$lc">$lnP</bdi>] <b>∙</b> <!--\n-->}}'
}
})
)
end
--[=[
Provide logic for [[Template:Ll]] (Language Links internal, to be substituted, language names written exactly as #language would provide them)
Warning: may expands too many costly #ifexist without limitation (if not substituted into a separate "/lang" template)
]=]
function p.ll(frame)
return frame:preprocess(
p.forEachLanguage({
args = {
pattern = '{{subst:#ifexist:{{{1}}}/$lc|[[{{{1}}}/$lc|<bdi class="language lang-$lc" lang="$lc">$lnP</bdi>]] <b>∙</b> <!--\n-->}}'
}
})
)
end
--------------------------------------------------------
--- Different approaches for [[Template:Lang links]] ---
--------------------------------------------------------
--[=[
Provide logic for [[Template:Lang links]]
Using a cute Hybrid-Method:
First check the subpages which is quite fast; if there are too many fall back to checking for each language page individually
]=]
-- =p.langLinksNonExpensive({ args= { page='Commons:Picture of the Year/2010' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='Main Page' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='Template:No_source_since' }, getParent=function() end })
-- =p.langLinksNonExpensive({ args= { page='MediaWiki:Gadget-HotCat' }, getParent=function() end })
function p.langLinksNonExpensive(frame)
local args, pargs = frame.args, ( frame:getParent() or {} ).args or {};
local title = args.page or args[1] or pargs.page or pargs[1] or "";
local contentLangInstance = mw.language.getContentLanguage();
local pages2
if frame.preprocess == nil then
frame = mw.getCurrentFrame()
end
--[==[
local options = {
abort = {
time = 3.5,
on = function()
pages2 = p.forEachLanguage({
args = {
pattern = '{{#ifexist:' .. title .. '/$lc|[[' .. title .. '/$lc|<bdi lang="$lc">$lnP</bdi>]] <b>∙</b> }}'
}
})
end
}
}
local pages = language_subpages( frame,
function( title, page, code, langname )
return mw.ustring.format(
'[[%s/%s|<bdi lang="%s">%s</bdi>]]</span> <b>∙</b> ',
title, page, code, langname
)
end, options );
return pages2 and frame:preprocess(pages2) or table.concat(pages, '');
--]==]
return frame:preprocess(
p.forEachLanguage( {
args = {
pattern = '{{#ifexist:' .. title .. '/$lc|[[' .. title .. '/$lc|<bdi lang="$lc">$lnP</bdi>]] <b>∙</b> }}'
}
})
)
end
---------------------------------------------------------
----------------- [[Template:Autolang]] -----------------
---------------------------------------------------------
--[[
Works like {{autotranslate}} just allowing an unlimited number of arguments, even named arguments.
It's doing Magic! No arguments should be passed to {{#invoke:}}
]]
function p.autolang(frame)
local args, pargs = cloneArgs( frame )
if nil == args.useargs then
if not args.base then args = pargs end
elseif 'both' == args.useargs then
for k,v in pairs(args) do pargs[k] = v end
args = pargs
elseif 'parent' == args.useargs then
args = pargs
if pargs.base and not args.base then
args.base = pargs.base
end
end
local base = args.base
local userlang = frame:preprocess( '{{Int:Lang}}' )
local tl, tlns = 'Template:', 10
local tlb, fallback1, currenttemplate
local fallback, contentlang = mw.text.split( userlang, '-', true )[1], mw.language.getContentLanguage():getCode()
local createReturn = function(title)
local ret
local tlargs = {}
-- When LUA is invoked, templates are already expanded. This must be respected.
return frame:expandTemplate{ title = title, args = args }
end
if not base then
return ("'autolang' in [[Module:Languages]] was called but the 'base' parameter could not be found." ..
"The base parameter specifies the template that's subpages will be sought for a suitable translation.")
end
tlb = tl .. base .. '/'
currenttemplate = tlb .. userlang
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
fallback1 = frame:preprocess( '{{Fallback|1=' .. base .. '|2=' .. userlang .. '}}' )
if fallback1 ~= contentlang then
return createReturn(tlb .. fallback1)
end
currenttemplate = tlb .. fallback
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
currenttemplate = tlb .. contentlang
local ok, exists = pcall( function()
return mw.title.new( currenttemplate, tlns ).exists
end )
if ok and exists then
return createReturn(currenttemplate)
end
return createReturn(tl .. base)
end
--[=[
Usage:
{{#invoke:languages|isKnownLanguageTag|gsw}} -> 1
{{#invoke:languages|isKnownLanguageTag|doesNotExist}} ->
]=]
function p.isKnownLanguageTag(frame)
return mw.language.isKnownLanguageTag( frame.args[1] or frame.args.tag or frame.args.code or '' ) and '1' or ''
end
function p.file_languages(frame)
local M_link = require( 'Module:Link' )
local contentLangInstance = mw.language.getContentLanguage()
local pattern = frame.args.pattern or '%s (%s)'
local original = frame.args.original or mw.title.getCurrentTitle().text
local ext_start, _ = string.find( original, '\.%w+$' )
local file_ext = string.sub( original, ext_start )
original = string.sub( original, 0, ext_start - 1 )
return frame:preprocess(
'<gallery>\n' ..
(table.concat(
M_link.forEachLink(
p.forEachLanguage({
args = { pattern = '[[$lc]]' }
}),
function( linkInfo )
local filename = mw.ustring.format( pattern, original, linkInfo.text ) .. file_ext
local ok, exists = pcall( function()
return mw.title.new( filename, 6 ).exists
end )
if ok and exists then
return mw.ustring.format( '%s|%s',
filename,
mw.language.fetchLanguageName( linkInfo.text )
)
else
return nil
end
end
), '\n'
)) ..
'\n</gallery>'
)
end
function p.runTests()
return p.langLinksNonExpensive({
args = {
page = 'Module:Languages/testcases/test'
},
getParent = function() end
}) ==
'[[Module:Languages/testcases/test/de|<bdi lang="de">Deutsch</bdi>]] <b>∙</b> ' ..
'[[Module:Languages/testcases/test/en|<bdi lang="en">English</bdi>]] <b>∙</b> '
end
return p;
705eceab8ff681939d35feb55e6209ca506ef16d
Module:No globals
828
64
144
143
2022-01-07T08:25:42Z
TheSink
2
1 revision imported
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
Module:TNT
828
65
146
145
2022-01-07T08:25:43Z
TheSink
2
1 revision imported
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
Module:TNTFallback
828
66
148
147
2022-01-07T08:25:44Z
TheSink
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- This module implements a wrapper for [[Module:TNT]] that allows returning
-- a fallback message; used by {{Documentation}}.
--
-- @module TNTFallback
-- @alias p
-- @author [[User:ExE Boss]]
-- @require [[Module:No globals]]
-- @require [[Module:TNT]]
--------------------------------------------------------------------------------
require("Module:No globals");
local TNT = require("Module:TNT");
local p = {};
--------------------------------------------------------------------------------
-- Based on [[Module:TNT]]'s `msg` function,
-- but takes an optional `fallback` parameter.
--------------------------------------------------------------------------------
function p.msg(frame)
local dataset, key;
local params = { n = 0 };
local lang = nil;
local fallback = nil;
for k, v in pairs(frame.args) do
if (k == 1) then
dataset = v;
elseif (k == 2) then
key = v;
elseif (type(k) == "number" and k > 2) then
local i = k - 2;
params[i] = v;
params.n = math.max(params.n, i);
elseif ((k == "lang") and (v ~= "_")) then
lang = v;
elseif ((k == "fallback") and (v ~= "")) then
fallback = v;
end
end
local result;
if (lang) then
result = TNT.formatInLanguage(lang, dataset, key, unpack(params, 1, params.n));
else
result = TNT.format(dataset, key, unpack(params, 1, params.n));
end
if (fallback and (
-- not translated
(result and result == TNT.formatInLanguage("en", dataset, key, unpack(params, 1, params.n)))
-- no message
or (not result)
)) then
if (not lang) then
if (frame:callParserFunction("int:lang") ~= "en") then
return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
end
elseif (lang ~= "en") then
return mw.message.newRawMessage(fallback, unpack(params, 1, params.n)):plain();
end
end
return result;
end
return p;
62207ae74661fcf554ea78320f07e5c0d63b41c0
Module:TableTools
828
67
150
149
2022-01-07T08:25:44Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
if type(v) == 'number' and tostring(v) == '-nan' then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
return p
ab9df0eb210b08945b9eed86435858f6e931a79a
Module:TemplateBox
828
68
152
151
2022-01-07T08:25:45Z
TheSink
2
1 revision imported
Scribunto
text/plain
require('Module:No globals')
--[[
@exports
usagesample( frame )
argcount( frame )
args2table( args, onGetKey, forCustom )
paramtable( frame )
description( frame )
templatedata( frame )
]]
local p = {}
-- Helper function, not exposed
local function tobool(st)
if type( st ) == 'string' then
return st == 'true'
else
return not not st
end
end
-- Required to determine in which languages the interface texts without langcode are
local contentLangcode = mw.language.getContentLanguage():getCode()
-- Forward declaration
local msg, langIsInit, userLang
local messagePrefix = "templatedata-doc-"
local i18n = {}
i18n['params'] = "Template parameters"
i18n['param-name'] = "Parameter"
i18n['param-desc'] = "Description"
i18n['param-type'] = "Type"
i18n['param-default'] = "Default"
i18n['param-status'] = "Status"
i18n['param-status-optional'] = "optional"
i18n['param-status-required'] = "required"
i18n['param-status-suggested'] = "suggested"
i18n['param-status-deprecated'] = "deprecated"
i18n['param-default-empty'] = "empty"
local function initLangModule(frame)
if langIsInit then
return
end
userLang = frame:preprocess( '{{int:lang}}' )
--! From [[:de:Modul:Expr]]; by [[:de:User:PerfektesChaos]];
--! Derivative work: Rillke
msg = function( key )
-- Retrieve localized message string in content language
-- Precondition:
-- key -- string; message ID
-- Postcondition:
-- Return some message string
-- Uses:
-- > messagePrefix
-- > i18n
-- > userLang
-- mw.message.new()
local m = mw.message.new( messagePrefix .. key )
local r = false
if m:isBlank() then
r = i18n[ key ]
else
m:inLanguage( userLang )
r = m:plain()
end
if not r then
r = '((('.. key .. ')))'
end
return r
end -- msg()
langIsInit = true
end
-- A "hash" / table of everything TemplateData takes
-- to ease maintenance.
-- The type is automatically determined if t is omitted.
-- If the type does not match or can't be converted, an error will be thrown!
-- Available types (LUA-Types with exceptions):
-- InterfaceText, boolean, number, selection, table, string
-- selection*: - requires a selection-string of pipe-separated possibilities to be supplied
-- InterfaceText*: A free-form string (no wikitext) in the content-language of the wiki, or,
-- an object containing those strings keyed by language code.
local paraminfoTemplate = {
description = {
default = '',
t = 'InterfaceText',
alias = 'desc'
},
format = {
default = 'inline',
t = 'selection',
selection = 'inline|block',
alias = 'print',
extract = function(pargs, number, paramVal)
local m = { multi = 'block', one = 'inline', infobox = 'block' }
return m[paramVal] or 'inline'
end
}
}
local paraminfoTLParams = {
label = {
default = '',
t = 'InterfaceText'
},
required = {
default = false,
extract = function(pargs, number, paramVal)
local req = (pargs[number .. 'stat'] == 'required')
return tobool( paramVal or req )
end
},
suggested = {
default = false,
extract = function(pargs, number, paramVal)
local sugg = (pargs[number .. 'stat'] == 'suggested')
return tobool( paramVal or sugg )
end
},
description = {
default = '',
t = 'InterfaceText',
alias = 'd'
},
deprecated = {
default = false,
extract = function(pargs, number, paramVal)
local depr = (pargs[number .. 'stat'] == 'deprecated')
return tobool( paramVal or depr )
end
},
aliases = {
default = '',
t = 'table',
extract = function(pargs, number, paramVal)
local key = number .. 'aliases'
local tdkey = key .. '-td'
local aliases = pargs[tdkey] or pargs[key]
if aliases and mw.text.trim( aliases ) ~= '' then
local cleaned = {}
for m in mw.text.gsplit( aliases, '/', true ) do
cleaned[#cleaned+1] = mw.text.trim(m)
end
return cleaned
else
return nil
end
end
},
default = {
default = '',
t = 'string',
alias = 'def'
},
type = {
default = 'unknown',
t = 'selection',
selection = 'unknown|number|string|string/wiki-user-name|string/wiki-page-name|string/line|line|wiki-page-name|wiki-file-name|wiki-user-name|wiki-template-name|content|unbalanced-wikitext|date|url|boolean'
},
inherits = {
default = nil,
t = 'string'
},
autovalue = {
default = '',
t = 'string',
alias = 'av',
},
suggestedvalues = {
default = '',
t = 'table',
alias = 'sv',
extract = function(pargs, number, paramVal)
if paramVal == nil then
return nil
end
local cleaned = {}
for m in mw.text.gsplit( paramVal, '/', true ) do
cleaned[#cleaned+1] = mw.text.trim(m)
end
return cleaned
end,
},
-- sets will be treated differently because we can only have a plain structure in wikitext
}
local tableLayout = {
{
col = 'param-name',
width = '15%',
extract = function(item, renderCell, monolingual)
local alias, param = '', item.key
local aliasTT = '<span style="font-family: monospace; color:#777; border:1px solid #6A6A6A">'
param = '<code>' .. param .. '</code>'
if item.aliases then
alias = aliasTT .. table.concat(item.aliases, '</span><br />' .. aliasTT) .. '</span>'
param = table.concat({param, '<br /><div>', alias, '</div>'})
end
renderCell(param)
end
}, {
col = 'param-desc',
cols = 2,
width = '65%',
extract = function(item, renderCell, monolingual)
local label = item.label or ''
label = monolingual(label)
local labelLen = #label
local colspan = 2 - labelLen
if labelLen > 0 then
renderCell(label)
end
renderCell(monolingual(item.description), colspan)
end
}, {
col = 'param-default',
width = '10%',
extract = function(item, renderCell, monolingual)
local def = monolingual(item.default) or ''
if #def == 0 then
def = '<span class="mw-templatedata-doc-muted" style="color:#777; font-variant:small-caps">' .. msg('param-default-empty') .. '</span>'
end
renderCell(def)
end
}, {
col = 'param-status',
width = '10%',
extract = function(item, renderCell, monolingual)
local stat = msg('param-status-optional')
if item.required then
stat = '<b>' .. msg('param-status-required') .. '</b>'
elseif item.deprecated then
stat = msg('param-status-deprecated')
elseif item.suggested then
stat = msg('param-status-suggested')
end
renderCell(stat)
end
}
}
-- Initialize param info
-- Avoids having to add redundant information to the preceding tables
local function init( which )
local setDefault = function(v)
if v.t == nil and v.default ~= nil then
v.t = type( v.default )
end
if v.selection then
local selection = mw.text.split(v.selection, '|', true)
v.selection = {}
for _, sel in ipairs(selection) do
v.selection[sel] = true
end
end
end
for a, v in pairs( which ) do
setDefault(v)
end
end
local function initParamTables()
init( paraminfoTemplate )
init( paraminfoTLParams )
end
------------------------------------------------------
-------------------- USAGE PART ----------------------
------------------------------------------------------
function p.argcount( frame )
local pargs = ( frame:getParent() or {} ).args or {}
local ac = 0
for i, arg in pairs( pargs ) do
if ('number' == type(i)) then
ac = ac + 1
end
end
return ac
end
function p.usagesample( frame )
local pargs = ( frame:getParent() or {} ).args or {}
local multiline = (pargs.lines == 'multi' or pargs.print == 'multi' or pargs.print == 'infobox')
local align = pargs.print == 'infobox'
if not pargs.lines and not pargs.print and pargs.type == 'infobox' then
multiline = true
align = true
end
local sepStart = ' |'
local sepEnd = multiline and '\n' or ''
local sep = sepEnd
local subst = #(pargs.mustbesubst or '') > 0 and 'subst:' or ''
local beforeEqual = multiline and ' ' or ''
local equal = beforeEqual .. '= '
local templateTitle = pargs.name or ''
local args, argName, result = {}
local maxArgLen, eachArg = 0
sep = sep .. sepStart
local sparseIpairs = require('Module:TableTools').sparseIpairs
local comapareLegacyVal = function(val)
return val == 'optional-' or val == 'deprecated'
end
local shouldShow = function(i)
if comapareLegacyVal(pargs[i .. 'stat']) or
comapareLegacyVal(pargs[i .. 'stat-td']) or
pargs[i .. 'deprecated'] == true then
return false
end
return true
end
eachArg = function(cb)
for i, arg in sparseIpairs( pargs ) do
if ('number' == type(i)) then
argName = mw.text.trim( arg or '' )
if #argName == 0 then
argName = tostring(i)
end
if shouldShow(i) then
cb(argName)
end
end
end
end
if align then
eachArg(function( arg )
local argL = #arg
maxArgLen = argL > maxArgLen and argL or maxArgLen
end)
end
eachArg(function( arg )
local space = ''
if align then
space = (' '):rep(maxArgLen - #arg)
end
table.insert( args, argName .. space .. equal )
end)
if #args == 0 then
sep = ''
sepEnd = ''
sepStart = ''
end
if #templateTitle == 0 then
templateTitle = mw.title.getCurrentTitle().text
end
result = table.concat( args, sep )
result = table.concat({ mw.text.nowiki('{{'), subst, templateTitle, sep, result, sepEnd, '}}' })
if multiline then
-- Preserve whitespace in front of new lines
result = frame:callParserFunction{ name = '#tag', args = { 'poem', result } }
end
return result
end
------------------------------------------------------
------------------- GENERAL PART ---------------------
------------------------------------------------------
function p.args2table(args, onGetKey, consumer)
initParamTables()
local sets, asParamArray, laxtype, processParams, processDesc, unstrip
if 'paramtable' == consumer then
asParamArray = true
processParams = true
laxtype = true
elseif 'templatedata' == consumer then
sets = true
processParams = true
processDesc = true
unstrip = true
elseif 'description' == consumer then
processDesc = true
laxtype = true
end
-- All kind of strange stuff with the arguments is done, so play safe and make a copy
local pargs = mw.clone( args )
-- Array-like table containing all parameter-numbers that were passed
local templateArgs = {}
-- Arguments that are localized (i.e. the user passed 1desc-en=English description of parameter one)
local i18nTemplateArgs = {}
-- Ensure that tables end up as array/object (esp. when they are empty)
local tdata = {description="", params={}, sets={}}
local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject
local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray
setmetatable(tdata.params, isObject)
setmetatable(tdata.sets, isArray)
onGetKey = onGetKey or function( prefix, alias, param )
local key, key2, tdkey, tdkey2
key = prefix .. (alias or param)
key2 = prefix .. param
tdkey = key .. '-td'
tdkey2 = key2 .. '-td'
return tdkey, tdkey2, key, key2
end
local extractData = function( pi, number )
local prefix = number or ''
local ppv, paramVal
local key1, key2, key3, key4
local paramKey, paramTable, processKey
if number then
paramKey = mw.text.trim( pargs[number] )
if '' == paramKey then
paramKey = tostring( number )
end
paramTable = {}
if asParamArray then
paramTable.key = paramKey
table.insert(tdata.params, paramTable)
else
tdata.params[paramKey] = paramTable
end
end
for p, info in pairs( pi ) do
key1, key2, key3, key4 = onGetKey(prefix, info.alias, p)
paramVal = nil
processKey = function(key)
if paramVal ~= nil then return end
local plain, multilingual = pargs[key], i18nTemplateArgs[key]
paramVal = multilingual or plain
end
processKey( key1 )
processKey( key2 )
processKey( key3 )
processKey( key4 )
-- Ensure presence of entry in content language
ppv = pargs[key1] or pargs[key2] or pargs[key3] or pargs[key4] or info.default
if 'table' == type( paramVal ) then
if (nil == paramVal[contentLangcode]) then
paramVal[contentLangcode] = ppv
end
else
paramVal = ppv
end
if 'function' == type( info.extract ) then
if 'string' == type( paramVal ) then
paramVal = mw.text.trim( paramVal )
if '' == paramVal then
paramVal = nil
end
end
paramVal = info.extract( pargs, number, paramVal )
end
local insertValue = function()
if number then
paramTable[p] = paramVal
else
tdata[p] = paramVal
end
end
if info.selection then
if info.selection[paramVal] then
insertValue()
end
elseif 'InterfaceText' == info.t then
if ({ table=1, string=1 })[type( paramVal )] then
insertValue()
end
else
local paramType = type( paramVal )
if 'string' == info.t and 'string' == paramType then
paramVal = mw.text.trim( paramVal )
if '' ~= paramVal then
insertValue()
end
elseif 'boolean' == info.t then
paramVal = tobool(paramVal)
insertValue()
elseif 'number' == info.t then
paramVal = tonumber(paramVal)
insertValue()
elseif paramType == info.t then
insertValue()
elseif paramType == 'nil' then
-- Do nothing
elseif not laxtype and 'string' == info.t and 'table' == paramType then
-- Convert multilingual object into content language string
paramVal = paramVal[contentLangcode]
insertValue()
else
if laxtype then
insertValue()
else
error( p .. ': Is of type ' .. paramType .. ' but should be of type ' .. (info.t or 'unknown'), 1 )
end
end
end
end
-- Now, treat sets
if sets then
key1 = prefix .. 'set-td'
key2 = prefix .. 'set'
paramVal = pargs[key1] or pargs[key2]
if paramVal then
local found = false
for i, s in ipairs( tdata.sets ) do
if s.label == paramVal then
table.insert( s.params, p )
found = true
end
end
if not found then
table.insert( tdata.sets, {
label = paramVal,
params = { p }
} )
end
end
end
end
-- First, analyse the structure of the provided arguments
for a, v in pairs( pargs ) do
if unstrip then
v = mw.text.unstrip( v )
pargs[a] = v
end
if type( a ) == 'number' then
table.insert( templateArgs, a )
else
local argSplit = mw.text.split( a, '-', true )
local argUnitl = {}
local argAfter = {}
local isTDArg = false
local containsTD = a:find( '-td', 1, true )
for i, part in ipairs( argSplit ) do
if isTDArg or (containsTD == nil and i > 1) then
-- This is likely a language version
table.insert( argAfter, part )
else
table.insert( argUnitl, part )
end
if part == 'td' then
isTDArg = true
end
end
if #argAfter > 0 then
argUnitl = table.concat( argUnitl, '-' )
argAfter = table.concat( argAfter, '-' )
i18nTemplateArgs[argUnitl] = i18nTemplateArgs[argUnitl] or {}
i18nTemplateArgs[argUnitl][argAfter] = v
end
end
end
-- Then, start building the actual template
if processDesc then
extractData( paraminfoTemplate )
end
if processParams then
-- Ensure that `templateArgs` contains indicies in ascending order
table.sort( templateArgs )
for i, number in pairs( templateArgs ) do
extractData( paraminfoTLParams, number )
end
end
return tdata, #templateArgs
end
------------------------------------------------------
------------ CUSTOM PARAMETER TABLE PART -------------
------------------------------------------------------
-- A custom key-pref-function
local customOnGetKey = function( prefix, alias, param )
local key, key2, tdkey, tdkey2
key = prefix .. (alias or param)
key2 = prefix .. param
tdkey = key .. '-td'
tdkey2 = key2 .. '-td'
return key2, key, tdkey2, tdkey
end
local toUserLanguage = function(input)
if type(input) == 'table' then
input = require( 'Module:LangSwitch' )._langSwitch( input, userLang ) or ''
end
return input
end
function p.description(frame)
local pargs = ( frame:getParent() or {} ).args or {}
-- Initialize the language-related stuff
initLangModule(frame)
local tdata, paramLen
tdata, paramLen = p.args2table(pargs, customOnGetKey, 'description')
return toUserLanguage(tdata.description)
end
function p.paramtable(frame)
local pargs = ( frame:getParent() or {} ).args or {}
local tdata, paramLen
if 'only' == pargs.useTemplateData then
return 'param table - output suppressed'
end
-- Initialize the language-related stuff
initLangModule(frame)
tdata, paramLen = p.args2table(pargs, customOnGetKey, 'paramtable')
if 0 == paramLen then
return ''
end
local row, rows = '', {}
local renderCell = function(wikitext, colspan)
local colspan, oTd = colspan or 1, '<td>'
if colspan > 1 then
oTd = '<td colspan="' .. colspan .. '">'
end
row = table.concat({ row, oTd, wikitext, '</td>' })
end
-- Create the header
for i, field in ipairs( tableLayout ) do
local style = ' style="width:' .. field.width .. '"'
local colspan = ''
if field.cols then
colspan = ' colspan="' .. field.cols .. '"'
end
local th = '<th' .. style .. colspan .. '>'
row = row .. th .. msg(field.col) .. '</th>'
end
table.insert(rows, row)
-- Now transform the Lua-table into an HTML-table
for i, item in ipairs( tdata.params ) do
row = ''
for i2, field in ipairs( tableLayout ) do
field.extract(item, renderCell, toUserLanguage)
end
table.insert(rows, row)
end
return '<table class="wikitable templatebox-table"><tr>' .. table.concat(rows, '</tr><tr>') .. '</tr></table>'
end
------------------------------------------------------
----------------- TEMPLATEDATA PART ------------------
------------------------------------------------------
-- A real parser/transformer would look differently but it would likely be much more complex
-- The TemplateData-portion for [[Template:TemplateBox]]
function p.templatedata(frame)
local tdata
local args = frame.args or {}
local formatting = args.formatting
local pargs = ( frame:getParent() or {} ).args or {}
local useTemplateData = pargs.useTemplateData
if (formatting == 'pretty' and useTemplateData ~= 'export') or
(not useTemplateData) or
(useTemplateData == 'export' and formatting ~= 'pretty') then
local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
mw.log(warning)
tdata = '{"description":"' .. warning .. '","params":{},"sets":[]}'
return tdata
end
-- Load the JSON-Module which will convert LUA tables into valid JSON
local JSON = require('Module:JSON')
JSON.strictTypes = true
-- Obtain the object containing info
tdata = p.args2table(pargs, nil, 'templatedata')
-- And finally return the result
if formatting == 'pretty' then
return JSON:encode_pretty(tdata)
else
return JSON:encode(tdata)
end
end
return p
5012975efde71b42159a90db1abc19cdb0afb9a0
Module:Tmpl
828
69
154
153
2022-01-07T08:25:46Z
TheSink
2
1 revision imported
Scribunto
text/plain
-- This is a helper module for Template:tmpl
local this = {}
function this.renderTmpl(frame)
local args = frame.args
local pargs = (frame:getParent() or {}).args
local result = pargs[0] or ''
for k, v in pairs(pargs) do
local n = tonumber(k) or -1
if (n >= 1 and n <= 9) then
result = mw.ustring.gsub( result, '$' .. n, mw.text.trim(v) )
end
end
return result
end
return this
7dcfd761abcd3c0d9977b26f961d5dc5052449e3
Template:Anchor
10
70
156
155
2022-01-07T08:25:47Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{{{{|safesubst:}}}#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
6b59a8a0f344484cb585cdf542e35cc889526d88
Template:And
10
71
158
157
2022-01-07T08:25:47Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Conj-and]]
66eac08dac0f7de405aa2dc7bfe01a50c7c3c332
Template:Clickable button 2/Icons
10
72
160
159
2022-01-07T08:25:47Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<!-- Liste von http://api.jqueryui.com/theming/icons/ -->
<ul style="list-style-type:none;list-style-image:none;">
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-n"> </span>
<span>carat-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-ne"> </span>
<span>carat-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-e"> </span>
<span>carat-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-se"> </span>
<span>carat-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-s"> </span>
<span>carat-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-sw"> </span>
<span>carat-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-w"> </span>
<span>carat-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-1-nw"> </span>
<span>carat-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-2-n-s"> </span>
<span>carat-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-carat-2-e-w"> </span>
<span>carat-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-n"> </span>
<span>triangle-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-ne"> </span>
<span>triangle-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-e"> </span>
<span>triangle-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-se"> </span>
<span>triangle-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-s"> </span>
<span>triangle-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-sw"> </span>
<span>triangle-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-w"> </span>
<span>triangle-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-1-nw"> </span>
<span>triangle-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-2-n-s"> </span>
<span>triangle-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-triangle-2-e-w"> </span>
<span>triangle-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-n"> </span>
<span>arrow-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-ne"> </span>
<span>arrow-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-e"> </span>
<span>arrow-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-se"> </span>
<span>arrow-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-s"> </span>
<span>arrow-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-sw"> </span>
<span>arrow-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-w"> </span>
<span>arrow-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-1-nw"> </span>
<span>arrow-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-n-s"> </span>
<span>arrow-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-ne-sw"> </span>
<span>arrow-2-ne-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-e-w"> </span>
<span>arrow-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-2-se-nw"> </span>
<span>arrow-2-se-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-n"> </span>
<span>arrowstop-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-e"> </span>
<span>arrowstop-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-s"> </span>
<span>arrowstop-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowstop-1-w"> </span>
<span>arrowstop-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-n"> </span>
<span>arrowthick-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-ne"> </span>
<span>arrowthick-1-ne</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-e"> </span>
<span>arrowthick-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-se"> </span>
<span>arrowthick-1-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-s"> </span>
<span>arrowthick-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-sw"> </span>
<span>arrowthick-1-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-w"> </span>
<span>arrowthick-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-1-nw"> </span>
<span>arrowthick-1-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-n-s"> </span>
<span>arrowthick-2-n-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-ne-sw"> </span>
<span>arrowthick-2-ne-sw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-e-w"> </span>
<span>arrowthick-2-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthick-2-se-nw"> </span>
<span>arrowthick-2-se-nw</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-n"> </span>
<span>arrowthickstop-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-e"> </span>
<span>arrowthickstop-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-s"> </span>
<span>arrowthickstop-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowthickstop-1-w"> </span>
<span>arrowthickstop-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-w"> </span>
<span>arrowreturnthick-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-n"> </span>
<span>arrowreturnthick-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-e"> </span>
<span>arrowreturnthick-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturnthick-1-s"> </span>
<span>arrowreturnthick-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-w"> </span>
<span>arrowreturn-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-n"> </span>
<span>arrowreturn-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-e"> </span>
<span>arrowreturn-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowreturn-1-s"> </span>
<span>arrowreturn-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-w"> </span>
<span>arrowrefresh-1-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-n"> </span>
<span>arrowrefresh-1-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-e"> </span>
<span>arrowrefresh-1-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrowrefresh-1-s"> </span>
<span>arrowrefresh-1-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-4"> </span>
<span>arrow-4</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-arrow-4-diag"> </span>
<span>arrow-4-diag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-extlink"> </span>
<span>extlink</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-newwin"> </span>
<span>newwin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-refresh"> </span>
<span>refresh</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-shuffle"> </span>
<span>shuffle</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-transfer-e-w"> </span>
<span>transfer-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-transferthick-e-w"> </span>
<span>transferthick-e-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-folder-collapsed"> </span>
<span>folder-collapsed</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-folder-open"> </span>
<span>folder-open</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-document"> </span>
<span>document</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-document-b"> </span>
<span>document-b</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-note"> </span>
<span>note</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-mail-closed"> </span>
<span>mail-closed</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-mail-open"> </span>
<span>mail-open</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-suitcase"> </span>
<span>suitcase</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-comment"> </span>
<span>comment</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-person"> </span>
<span>person</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-print"> </span>
<span>print</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-trash"> </span>
<span>trash</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-locked"> </span>
<span>locked</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-unlocked"> </span>
<span>unlocked</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-bookmark"> </span>
<span>bookmark</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-tag"> </span>
<span>tag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-home"> </span>
<span>home</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-flag"> </span>
<span>flag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-calculator"> </span>
<span>calculator</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-cart"> </span>
<span>cart</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pencil"> </span>
<span>pencil</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-clock"> </span>
<span>clock</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-disk"> </span>
<span>disk</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-calendar"> </span>
<span>calendar</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-zoomin"> </span>
<span>zoomin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-zoomout"> </span>
<span>zoomout</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-search"> </span>
<span>search</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-wrench"> </span>
<span>wrench</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-gear"> </span>
<span>gear</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-heart"> </span>
<span>heart</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-star"> </span>
<span>star</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-link"> </span>
<span>link</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-cancel"> </span>
<span>cancel</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-plus"> </span>
<span>plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-plusthick"> </span>
<span>plusthick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-minus"> </span>
<span>minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-minusthick"> </span>
<span>minusthick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-close"> </span>
<span>close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-closethick"> </span>
<span>closethick</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-key"> </span>
<span>key</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-lightbulb"> </span>
<span>lightbulb</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-scissors"> </span>
<span>scissors</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-clipboard"> </span>
<span>clipboard</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-copy"> </span>
<span>copy</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-contact"> </span>
<span>contact</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-image"> </span>
<span>image</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-video"> </span>
<span>video</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-script"> </span>
<span>script</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-alert"> </span>
<span>alert</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-info"> </span>
<span>info</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-notice"> </span>
<span>notice</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-help"> </span>
<span>help</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-check"> </span>
<span>check</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-bullet"> </span>
<span>bullet</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-radio-off"> </span>
<span>radio-off</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-radio-on"> </span>
<span>radio-on</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pin-w"> </span>
<span>pin-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pin-s"> </span>
<span>pin-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-play"> </span>
<span>play</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-pause"> </span>
<span>pause</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-next"> </span>
<span>seek-next</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-prev"> </span>
<span>seek-prev</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-end"> </span>
<span>seek-end</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-seek-first"> </span>
<span>seek-first</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-stop"> </span>
<span>stop</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-eject"> </span>
<span>eject</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-volume-off"> </span>
<span>volume-off</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-volume-on"> </span>
<span>volume-on</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-power"> </span>
<span>power</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-signal-diag"> </span>
<span>signal-diag</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-signal"> </span>
<span>signal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-0"> </span>
<span>battery-0</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-1"> </span>
<span>battery-1</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-2"> </span>
<span>battery-2</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-battery-3"> </span>
<span>battery-3</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-plus"> </span>
<span>circle-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-minus"> </span>
<span>circle-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-close"> </span>
<span>circle-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-e"> </span>
<span>circle-triangle-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-s"> </span>
<span>circle-triangle-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-w"> </span>
<span>circle-triangle-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-triangle-n"> </span>
<span>circle-triangle-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-e"> </span>
<span>circle-arrow-e</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-s"> </span>
<span>circle-arrow-s</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-w"> </span>
<span>circle-arrow-w</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-arrow-n"> </span>
<span>circle-arrow-n</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-zoomin"> </span>
<span>circle-zoomin</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-zoomout"> </span>
<span>circle-zoomout</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circle-check"> </span>
<span>circle-check</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-plus"> </span>
<span>circlesmall-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-minus"> </span>
<span>circlesmall-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-circlesmall-close"> </span>
<span>circlesmall-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-plus"> </span>
<span>squaresmall-plus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-minus"> </span>
<span>squaresmall-minus</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-squaresmall-close"> </span>
<span>squaresmall-close</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-dotted-vertical"> </span>
<span>grip-dotted-vertical</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-dotted-horizontal"> </span>
<span>grip-dotted-horizontal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-solid-vertical"> </span>
<span>grip-solid-vertical</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-solid-horizontal"> </span>
<span>grip-solid-horizontal</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-gripsmall-diagonal-se"> </span>
<span>gripsmall-diagonal-se</span>
</li>
<li style="width:13em;float:left;">
<span style="display:inline-block;vertical-align:text-bottom;" class="ui-icon ui-icon-grip-diagonal-se"> </span>
<span>grip-diagonal-se</span>
</li>
</ul><noinclude></noinclude>
4b72ae93de1029b8b0f8decc15c742a130981cdc
Template:Clickable button 2/doc
10
73
162
161
2022-01-07T08:25:49Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{TemplateBox
|name = Clickable button 2
|desc-de = Diese Vorlage erlaubt es, auf einfache Weise (ohne HTML- oder CSS-Kenntnisse) Schaltflächen (Buttons) zu erstellen, welche die Verlinkung beliebiger Inhalte auf Wikipedia, sowie auf externen Seiten erlauben. Damit können z.B. Projekt- und Benutzerseiten visuell ansprechend präsentiert werden.
Zur grafischen Gestaltung stehen viele vordefinierte Icons zur Verfügung, alternativ können beliebige lokal gespeicherte oder auf Commons verfügbare Grafiken eingebunden werden. Weiterhin stellt die Vorlage drei verschiedene Farbschemata in mehreren Variationen zur Verfügung. Der Linktext kann beliebig mit Wikitext und/oder HTML/CSS gestaltet werden.
|desc-en = This template allows creating buttons that link to Commons-internal pages, or external pages without HTML and CSS knowledge. Project or user pages can be visually enhanced using this button, for example.
A bunch of predefined icons and, additionally any graphic hosted at Wikimedia Commons can be included to further enhance the User Experience (UX). On top of that, the template provides 3 different color schemas, each of them with different variants. The link text can be customized using wiki text and/or HTML/CSS.
|1 = link
|1aliases = 1
|1d-de = Gibt das Linkziel an. Erlaubt ist
* entweder ein Wikilink (ohne die doppelten Klammern <code><nowiki>[[…]]</nowiki></code>), z.B. einfach <code>"link = Wikipedia"</code> um auf die Seite der [[Wikipedia]]-Galerie zu gelangen, oder
* ein externer Link (ohne die einfachen Klammern <code><nowiki>[…]</nowiki></code>), z.B. einfach <code><nowiki>"link = https://test.de"</nowiki></code> um auf https://test.de zu verlinken.
|1d-td-de = Gibt das Linkziel an. Erlaubt ist
* entweder ein Wikilink (ohne die doppelten Klammern <code><nowiki>[[…]]</nowiki></code>), z.B. einfach <code>"link = Wikipedia"</code> um auf die Seite der Wikipedia-Galerie zu gelangen, oder
* ein externer Link (ohne die einfachen Klammern <code><nowiki>[…]</nowiki></code>), z.B. einfach <code><nowiki>"link = https://test.de"</nowiki></code> um auf https://test.de zu verlinken.
|1d-en = Specifies the link target:
* Either a wiki link (without double square brackets <code><nowiki>[[…]]</nowiki></code>), e.g. simply <code>"link = Wikipedia"</code> for a link to the [[Wikipedia]] gallery page, or
* an external link (without the square brackets <code><nowiki>[…]</nowiki></code>), e.g. simply <code><nowiki>"link = https://example.com"</nowiki></code> for a link to https://example.com.
|1d-td-en = Specifies the link target:
* Either a wiki link (without double square brackets <code><nowiki>[[…]]</nowiki></code>), e.g. simply <code>"link = Wikipedia"</code> for a link to the Wikipedia gallery page, or
* an external link (without the square brackets <code><nowiki>[…]</nowiki></code>), e.g. simply <code><nowiki>"link = https://example.com"</nowiki></code> for a link to https://example.com.
|1def=Main Page
|1type = string/wiki-page-name
|1stat = required
|2 = text
|2aliases = 2
|2d-de = Der Text, den der Button enthalten soll.<br />Der Linktext kann beliebig mit Wikitext und/oder HTML/CSS gestaltet werden.<br />Es ist auch eine leere Angabe <code><nowiki>text=</nowiki></code> möglich, wenn der Button nur ein Icon oder Bild enthalten soll.
|2d-en = The text the button should display.<br />Can be customized using wiki text and/or HTML/CSS.<br />Also an empty text parameter <code><nowiki>text=</nowiki></code> is permitted if only a graphic or an icon should be displayed.
|2def = Button
|2type = string
|2stat = optional
|3 = title
|3aliases = Titel
|3d-de = Der Text, welcher als Tooltip erscheinen soll.<br />Standardmäßig wird der Seitentitel (Wikilink) bzw. die URL (externer Link) angezeigt.
|3d-en = Text for the tooltip. By default the page title (wiki links) or the URL (external inks) is displayed.
|3def = (link target)
|3type = string
|3stat = optional-
|4 =icon
|4d-de = Der Name eines vordefinierten Icons, welches auf dem Button erscheinen soll (z.B. <code>"icon = refresh"</code> für <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />''[[#icons|→ Liste der Icons]]''
|4d-td-de = Der Name eines vordefinierten Icons, welches auf dem Button erscheinen soll (z.B. <code>"icon = refresh"</code> für <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />Siehe Liste der Icons in der Dokumentation dieser Vorlage.
|4d-en = Name of a pre-defined icon, which should be shown on the button (e.g. <code>"icon = refresh"</code> for <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />''[[#icons|→ Icon list]]''
|4d-td-en = Name of a pre-defined icon, which should be shown on the button (e.g. <code>"icon = refresh"</code> for <span class="ui-icon ui-icon-refresh" style="display:inline-block;vertical-align:text-bottom;"> </span>)<br />See icon list in documentation of this template.
|4type = string
|4stat = optional-
|5 = image
|5aliases = Bild
|5d-de = Ein auf Commons vorhandenes Bild, welches auf dem Button angezeigt werden soll.<br />Die Einbindung erfolgt inklusive Größenangabe mit Wikisyntax (z.B. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code> für [[File:checkmark.svg|16px|link=|middle]]).
|5d-td-de = Ein auf Commons vorhandenes Bild, welches auf dem Button angezeigt werden soll.<br />Die Einbindung erfolgt inklusive Größenangabe mit Wikisyntax (z.B. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code>).
|5d-en = A file on Commons and its dimensions. Inclusion using Wiki-Syntax (e.g. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code> for [[File:checkmark.svg|16px|link=|middle]]).
|5d-td-en = A file on Commons and its dimensions. Inclusion using Wiki-Syntax (e.g. <code><nowiki>image = [[File:checkmark.svg|16px]]</nowiki></code>).
|5type = string
|5stat = optional-
|6 = color
|6aliases = Farbe
|6d-de = Gibt ein Farbschema für den Button vor (z.B. <code>"color = blue"</code>).<br />Mögliche Werte sind <code>rot/red/blau/blue/grün/green</code>, <code>rot2/red2/blau2/blue2/grün2/green2</code> sowie <code>rot3/red3/blau3/blue3/grün3/green3</code> (siehe [[#colors|Abschnitt]] in den Verwendungshinweisen).
|6d-td-de = Gibt ein Farbschema für den Button vor (z.B. <code>"color = blue"</code>).<br />Mögliche Werte sind <code>rot/red/blau/blue/grün/green</code>, <code>rot2/red2/blau2/blue2/grün2/green2</code> sowie <code>rot3/red3/blau3/blue3/grün3/green3</code> (siehe entsprechenden Abschnitt in den Verwendungshinweisen).
|6d-en = Specifies the color-scheme for the button (z.B. <code>"color = blue"</code>).<br />Possible values are <code>red/blue/green</code>, <code>red2/blue2/green2</code>, and also <code>red3/blue3/green3</code> or their German counterparts (see [[#colors|section]] in usage notes).
|6d-td-en = Specifies the color-scheme for the button (z.B. <code>"color = blue"</code>).<br />Possible values are <code>red/blue/green</code>, <code>red2/blue2/green2</code>, and also <code>red3/blue3/green3</code> or their German counterparts (see regarding section in usage notes).
|6type = string
|6stat = optional-
|7 = padding
|7d-de = Gibt den Abstand zwischen Inhalt (Text, Bild, Icon) und dem Rand des Buttons an.<br /><code>"padding = 5px"</code> ergibt fünf Pixel breite Ränder auf allen Seiten. Werden zwei Werte angegeben (<code>"padding = 5px 5px"</code>) gelten diese für oben/unten bzw. links/rechts, Werden vier Werte angegeben (<code>"padding = 5px 5px 5px 5px"</code>) gelten diese für oben, rechts, unten bzw. links in dieser Reihenfolge.
|7d-en = Specifies the padding between content (text, graphic, icon) and border of the button. If one value is given it coubts for all sides, Two values are for top/bottom and left/right respectively. Four values count for top, right, bottom and left in this order (e.g. <code>"padding = 5px 15px 10px 20px"</code>).
|7def = 0.25em 0.5em
|7type = string
|7stat = optional-
|namespace = all
|usergroup = all
|usage-notes =
|type = formatting
|example = link=Main page|text=Link to Main Page
|example-value = {{Clickable button 2|link=Main page|text=Link to Main Page}}
|i18n-method = -
|seealso =
* {{tl|Button}} - just using CSS.
* {{tl|Clickable button}} - previous attempt.
* {{tl|Clickable button 3}} - mw.ui buttons, most recent version
* {{tl|Key press}}
|setscats =
|print = one
|relieson =
* [[Module:FileUtil]]
* [[Module:URLutil]]
|useTemplateData = 1
}}
== {{anchor|Verwendungshinweise}}{{anchor|Usage notes}}<!--
-->{{LangSwitch
|de=Verwendungshinweise
|en=Usage notes
}} ==
=== {{anchor|Grundlegende Verwendung}}<!--
-->{{anchor|Basic usage}}<!--
-->{{LangSwitch
|de=Grundlegende Verwendung
|en=Basic usage
}} ===
<ul>
<li>
'''Wikilinks, Interwikilinks {{and}} external links:'''<br />
<code><nowiki>{{Clickable button 2|link=Wikipedia|text=</nowiki>{{LangSwitch |de=Link zur Wikipedia-Galerie |en=Link to Wikipedia Gallery}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|text={{LangSwitch |de=Link zur Wikipedia-Galerie |en=Link to Wikipedia Gallery}} }}<br />
<code><nowiki>{{Clickable button 2|link=:en:Wikipedia|text=</nowiki>{{LangSwitch |de=Link zum Artikel <nowiki>''Wikipedia''</nowiki> in der englischen Wikipedia |en=Link to article <nowiki>''Wikipedia''</nowiki> in English Wikpedia}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|link=:en:Wikipedia|text={{LangSwitch |de=Link zum Artikel ''Wikipedia'' in der englischen Wikipedia |en=Link to article ''Wikipedia'' in English Wikipedia}} }}<br />
<code><nowiki>{{Clickable button 2|link=https://example.com|text=</nowiki>{{LangSwitch |de=Link zu |en=Link to}} <nowiki><kbd>https://example.com</kbd>}}</nowiki></code><br />
{{Clickable button 2|link=https://example.com|text={{LangSwitch |de=Link zu |en=Link to}} <kbd>https://example.com</kbd>}}
</li>
<li>
'''{{LangSwitch
|de=Die notwendigen Parameter<code>"link"</code> und <code>"text"</code> können benannte oder unbenannte Parameter sein:
|en=Required parameters <code>"link"</code> and <code>"text"</code> may be named parameters or unnamed params:
}}'''<br />
<code><nowiki>{{Clickable button 2|Wikipedia|Wikipedia-Galerie}}</nowiki></code> {{i18n/or}}<br />
<code><nowiki>{{Clickable button 2|1=Wikipedia|2=Wikipedia-Galerie}}</nowiki></code> {{i18n/or}}<br />
<code><nowiki>{{Clickable button 2|link=Wikipedia|text=Wikipedia-Galerie}}</nowiki></code><br />
{{Clickable button 2|Wikipedia|Wikipedia-Galerie}}
</li>
<li>
'''Tooltips:'''<br />
<code><nowiki>{{Clickable button 2|link=:en:Wikipedia|text=''Wikipedia''|title=</nowiki>{{LangSwitch |de=Link zum Artikel über die Wikipedia in der englischen Wikipedia |en=Link to article about Wikipedia in English Wikipedia}}<nowiki>&nbsp;:-) }}</nowiki></code><br />
{{Clickable button 2|link=:en:Wikipedia|text=''Wikipedia''|title={{LangSwitch |de=Link zum Artikel über die Wikipedia in der englischen Wikipedia |en=Link to article about Wikipedia in English Wikipedia}} :-) }}<!--
--> ''← {{LangSwitch
|de=Bitte mit der Maus auf die Schaltfläche gehen.
|en=Please hover the button.
}}''
</li>
</ul>
=== {{anchor|Fortgeschrittene Verwendung (URL-Parameter)}}<!--
-->{{anchor|Advanced usage (URL parameters)}}<!--
-->{{LangSwitch
|de=Fortgeschrittene Verwendung (URL-Parameter)
|en=Advanced usage (URL parameters)
}} ===
{{LangSwitch
|de=Um URL-Parameter angeben zu können, müssen auch Wikilinks in „externe“ URL umgewandelt werden. Diese können von Hand zusammengesetzt werden, einfacher und zuverlässiger geht es aber mit der
|en=To be able to specify URL parameters, also Wikilinks must be converted to "external" URLs. These can be assembled by hand, but it's easier and more reliable with the
}} [[:mw:Special:MyLanguage/Help:Magic words#Parser functions|<!--
-->{{LangSwitch
|de=Parserfunktion
|en=parser function
}}]] <code><nowiki>{{fullurl}}</nowiki></code>.
{{LangSwitch
|de=Beispielsweise liefert
|en=For instance yields
}}
* {{LangSwitch
|de=<code><nowiki>{{fullurl:Hauptseite}}</nowiki></code> die volle URL der Hauptseite: <code>{{fullurl:Hauptseite}}</code>
|en=<code><nowiki>{{fullurl:Main Page}}</nowiki></code> the full URL of the main page: <code>{{fullurl:Main Page}}</code>
}}
* <code><nowiki>{{fullurl:{{FULLPAGENAME}}}}</nowiki></code> <!--
-->{{LangSwitch
|de=die volle URL der aktuellen Seite:
|en=the full URL of current page:
}} <code>{{fullurl:{{FULLPAGENAME}}}}</code>
{{LangSwitch
|de=Über den ersten Parameter von <code><nowiki>{{fullurl}}</nowiki></code> können URL-Parameter an die URL angehängt werden:
|en=The first parameter of <code><nowiki>{{fullurl}}</nowiki></code> can be used to append URL parameters to the URL:
}}
*<code><nowiki>{{fullurl:Hauptseite|action=purge}}</nowiki></code> → <code>{{fullurl:Hauptseite|action=purge}}</code>
*<code><nowiki>{{fullurl:{{FULLPAGENAME}}|action=purge}}</nowiki></code> → <code>{{fullurl:{{FULLPAGENAME}}|action=purge}}</code>
{{LangSwitch
|de=Damit lässt sich nun einfach ein Button erstellen, der den Server-Cache der aktuellen Seite löscht:
|en=So it is easily possible to create a button that deletes the server cache of the current page:
}}<br />
<code><nowiki>{{Clickable button 2|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|text=</nowiki>{{LangSwitch |de=Cache leeren |en=Clear cache}}<nowiki>|icon=refresh}}</nowiki></code><br />
{{Clickable button 2|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|text={{LangSwitch |de=Cache leeren |en=Clear cache}}|icon=refresh}}<!--
--> ''← {{LangSwitch
|de=Dieser Button leert den Cache der aktuellen Seite.
|en=This button clears the cache of the current page.
}}''
{{LangSwitch
|de=Weitere hilfreiche URL-Parameter, die auf diese Weise mit Hilfe eines Buttons einfach zur Verfügung gestellt werden können, sind auf [[:de:Hilfe:URL-Parameter]] erklärt (siehe auch [[:mw:Manual:Parameters to index.php/de|Manual:Parameters to index.php/de]] auf Mediawiki). Es ist zu beachten, dass URL-Parameter, die Leerzeichen oder andere geschützte Zeichen wie <code>&</code> oder <code>?</code> enthalten, mit der Parserfunktion <code><nowiki>{{urlencode}}</nowiki></code> encodiert werden müssen!
|en=More helpful URL parameters, which can be easily provided with the help of a button, are explained in [[:mw:Manual:Parameters to index.php/de|Manual:Parameters to index.php]] on Mediawiki. Note that URL parameters containing spaces or other protected characters like <code>&</code> or <code>?</code> must be encoded with the parser function <code><nowiki>{{urlencode}}</nowiki></code>!
}}
=== {{anchor|Icons und Grafiken}}<!--
-->{{anchor|Icons and graphics}}<!--
-->{{LangSwitch
|de=Icons und Grafiken
|en=Icons and graphics
}} ===
<ul>
<li>
'''Icons'''<br />
<code><nowiki>{{Clickable button 2 | … |icon=mail-closed}}</nowiki></code><!--
--> → {{Clickable button 2|icon=mail-closed}}<br />
<code><nowiki>{{Clickable button 2 | … |text=|icon=mail-closed}}</nowiki></code><!--
--> → {{Clickable button 2|text=|icon=mail-closed}}<br />
''{{LangSwitch
|de=Zu möglichen Werten für <code>icon</code> siehe die [[#icons|Übersicht]] unten.
|en=For possible values of <code>icon</code> see [[#icons|overview]] below.
}}''
</li>
<li>
'''{{LangSwitch |de=Bilder |en=Images}}'''<br />
<code><nowiki>{{Clickable button 2 | … |image=[[File:checkmark.svg|18px]]}}</nowiki></code><!--
--> → {{Clickable button 2|image=[[File:checkmark.svg|18px]]}}<br />
<code><nowiki>{{Clickable button 2 | … |text=|image=[[File:checkmark.svg|30px]]}}</nowiki></code><!--
--> → {{Clickable button 2|text=|image=[[File:checkmark.svg|30px]]}}
</li>
</ul>
=== {{anchor|Farben und Innenabstand}}<!--
-->{{anchor|Colors and padding}}<!--
-->{{LangSwitch
|de=Farben und Innenabstand
|en=Colors and Padding
}} ===
<ul>
<li>{{anchor|colors}}
'''{{LangSwitch
|de=Farbschemata
|en=Color schemes}}:'''<br />
<code><nowiki>{{Clickable button 2 | … |color=</nowiki>{{LangSwitch |de=(Farbname) |en=(color name)}} <nowiki>}}</nowiki></code><br />
{{Clickable button 2|text='''red''' |color=red |padding=20px 33px}}
{{Clickable button 2|text='''green''' |color=green |padding=20px 33px}}
{{Clickable button 2|text='''blue''' |color=blue |padding=20px 33px}}<br />
{{Clickable button 2|text='''red2''' |color=red2 |padding=20px 30px}}
{{Clickable button 2|text='''green2''' |color=green2|padding=20px 30px}}
{{Clickable button 2|text='''blue2 ''' |color=blue2 |padding=20px 30px}}<br />
{{Clickable button 2|text='''red3''' |color=red3 |padding=20px 30px}}
{{Clickable button 2|text='''green3''' |color=green3|padding=20px 30px}}
{{Clickable button 2|text='''blue3''' |color=blue3 |padding=20px 30px}}
</li>
<li>
'''Padding:'''<br />
<div style="display:flex; flex-wrap: wrap;">
<div style="display: inline-block; width: 25em;">
<code><nowiki>{{Clickable button 2 | … |padding=0px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=10px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=0px}}
{{Clickable button 2|link=Wikipedia|padding=10px}}
{{Clickable button 2|link=Wikipedia|padding=20px}}
</div>
<div style="display: inline-block; width: 27em;">
<code><nowiki>{{Clickable button 2 | … |padding=20px 0px}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0px 20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=20px 0px}}
{{Clickable button 2|link=Wikipedia|padding=0px 20px}}
</div>
<div style="display: inline-block; width: 28.5em;">
<code><nowiki>{{Clickable button 2 | … |padding=20px 0 0 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 0 20px 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 20px 0 0}}</nowiki></code><br />
<code><nowiki>{{Clickable button 2 | … |padding=0 0 0 20px}}</nowiki></code><br />
{{Clickable button 2|link=Wikipedia|padding=20px 0 0 0}}
{{Clickable button 2|link=Wikipedia|padding=0 0 20px 0}}
{{Clickable button 2|link=Wikipedia|padding=0 20px 0 0}}
{{Clickable button 2|link=Wikipedia|padding=0 0 0 20px}}
</div>
</div>
</li>
</ul>
== {{anchor|icons}}{{anchor|Iconübersicht}}<!--
-->{{anchor|Icons overview}}<!--
-->{{LangSwitch
|de=Iconübersicht
|en=Icons overview
}} ==
'''{{LangSwitch
|de=Mögliche Werte für
|en=Possible values for
}} <code>icon</code>:'''
{{Clickable button 2/Icons}}
<includeonly>
<!-- Interwikis go on Wikidata, please add only Categories here -->
[[Category:Formatting templates]]
</includeonly>
14c532d2a814ce692f9dbe761cf6817e5ce80750
Template:Collapse bottom
10
74
164
163
2022-01-07T08:25:49Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
|}</div><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
fc7cbf7dfc70960dab3fcea6c526a682573c43b6
Template:Collapse top
10
75
166
165
2022-01-07T08:25:50Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible {{{{{|safesubst:}}}#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|EEF|CFC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{{{{|safesubst:}}}#if:{{{left|}}}|left|center}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <span style="font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|Extended content}}} }}} }}} }}} }}}</span>
{{{{{|safesubst:}}}#if:{{{warning|{{{2|}}}}}}
|{{{{{|safesubst:}}}!}}-
{{{{{|safesubst:}}}!}} style="text-align:center; font-style:italic;" {{{{{|safesubst:}}}!}} {{{2|The following is a closed debate. '''Please do not modify it.''' }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{{{{|safesubst:}}}!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
{{Collapse top/TemplateData}}
</noinclude>
729c380800dedf28ab73e7bc55c50fc198027881
Template:Conj-and
10
76
168
167
2022-01-07T08:25:50Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<noinclude>''This shows a localized coordination between numbers:'' 1<span style="background:yellow"></noinclude><!--
-->{{LangSwitch
| lang = {{#if: {{{lang|}}}
| {{{lang|}}}
| {{#switch: {{NAMESPACE}} |File|Creator = {{int:Lang}} |#default= {{PAGELANGUAGE}} }}
}}
| default =  {{localized mw message|and|missing= and |lang = {{#if: {{{lang|}}}
| {{{lang|}}}
| {{#switch: {{NAMESPACE}} |File|Creator = {{int:Lang}} |#default= {{PAGELANGUAGE}} }}
}}
}} 
| bg =  и 
| bn =  ও 
| ca =  i 
| cs =  a 
| da =  og 
| de =  und 
| eo =  kaj 
| es =  y 
| fa =  و
| fr =  et 
| he =  ו
| hu =  és 
| id =  dan 
| it =  e 
| ja = および
| ko =  와 
| mk =  и 
| nl =  en 
| no =  og 
| pl =  i <!-- Polish has 2 alternative versions of "and" : "oraz" and "i". Translatewiki has "oraz" but "i" works better in most cases. -->
| pt =  e 
| ru =  и 
| sk =  a 
| sl =  in 
| sv =  och 
| th = และ
| uk =  і 
|zh|zh-my|zh-sg|zh-cn|zh-hans = 和
|zh-mo|zh-hk|zh-tw|zh-hant = 和
}}<noinclude><!--
--></span>2.
{{Documentation}}
</noinclude>
46f50e4bfc18690f18d534f6bcca4afde5c7ca4e
Template:I18n/or
10
77
170
169
2022-01-07T08:25:50Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{langSwitch|lang={{{lang|}}}
|ar=أو
|bn=অথবা
|ca=o
|cs=nebo
|da=eller
|de=oder
|el=ή
|en=or
|eo=aŭ
|es=o<!-- /u -->
|et=või
|fa=یا
|fi=tai
|fr=ou
|gl=ou
|he=או
|hu=vagy
|it=o
|ja=または
|mk=или
|ml=അഥവാ
|nds=oder
|nl=of
|nn=eller
|no=eller
|os=ó
|pl=lub
|pt=ou
|pt-br=ou
|ro=sau
|ru=или
|sl=ali
|sv=eller
|tg=ё
|th=หรือ
|tr=ve
|uk=або
|zh=或
}}<noinclude>
{{documentation|i18n/doc}}
[[Category:Internationalization templates using LangSwitch|{{PAGENAME}}]]
[[Category:Commons templates-or|{{PAGENAME}}]]
</noinclude>
c33f32a97ebff25129031e26b5713a4022b5cb35
Template:Int
10
78
172
171
2022-01-07T08:25:51Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<onlyinclude>{{<includeonly>safesubst:</includeonly>#invoke:Int|renderIntMessage|{{{1}}}|missing={{{missing|}}}|lang={{{lang|}}}}}</onlyinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
7fcbf21aa479eefc0f0d45d3c4841770e0467388
Template:LangSwitch
10
79
174
173
2022-01-07T08:25:53Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:LangSwitch|langSwitch}}</includeonly><noinclude>
{{heavily used template}}
{{Documentation}}
</noinclude>
43a599bd276c3f0b29a41e77cfe705b2f085fb6d
Template:Localized mw message
10
80
176
175
2022-01-07T08:25:55Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Int]] {{Template redirect}}
ec2ef44b12b6d22453009b3bee9277dd944c0e67
Template:Main other
10
81
178
177
2022-01-07T08:25:55Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c8e5526da7586aff37928206e183ceef44ed7829
Module:Anchor
828
82
180
179
2022-01-07T08:25:57Z
TheSink
2
1 revision imported
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
args[1] = args[1] or args.anchor
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
1745d8c9a981c79c49af1d0921d54a38de7b8981
Module:Arguments
828
83
182
181
2022-01-07T08:25:58Z
TheSink
2
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:FileUtil
828
84
184
183
2022-01-07T08:25:59Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[=[ MediaUtil
Utilities for handling of media files, e.g. images, videos, ...
* addParameter()
* replaceParameter()
]=]
-- table for export
local FileUtil = {}
FileUtil.addParameter = function ( file, parameter, value ) -- "value" is optional (default: "nil")
return FileUtil.replaceParameter( file, parameter, value , false)
end -- FileUtil.addParameter()
FileUtil.replaceParameter = function ( file, parameter, value , replace) -- "value" is optional (default: "nil")
-- "replace" is optional (default: "true")
local replace = (replace == Nil or replace == true)
if type( file ) == "string" then
local fileNew,n = FileUtil.removeParameter(file, parameter)
if n==0 or replace then
if value then
fileNew = fileNew:gsub('(%]%])','|'..parameter..'='..value..']]')
else
fileNew = fileNew:gsub('(%]%])','|'..parameter..']]')
end
return fileNew
else
return file
end
end
return false
end -- FileUtil.replaceParameter()
FileUtil.removeParameter = function ( file, parameter )
if type( file ) == "string" then
local fileNew,n = file:gsub('|%s*'..parameter..'%s*[^|%]]*%s*([|%]])','%1')
return fileNew,n
end
return false
end -- FileUtil.removeParameter()
-- Provide template access and expose URLutil table to require
local p = {}
function p.addParameter( frame )
return FileUtil.addParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"],
frame.args[3] or frame.args["value"]) or ""
end
function p.replaceParameter( frame )
return FileUtil.replaceParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"],
frame.args[3] or frame.args["value"]) or ""
end
function p.removeParameter( frame )
return FileUtil.removeParameter( frame.args[1] or frame.args["file"],
frame.args[2] or frame.args["parameter"]) or ""
end
function p.FileUtil()
return FileUtil
end
return p
21b8ce921a622a9a34b889f6b9ce6c97b673ec86
Module:Int
828
85
186
185
2022-01-07T08:26:00Z
TheSink
2
1 revision imported
Scribunto
text/plain
-- This is a helper module for [[Template:int]]
local this = {}
function this.renderIntMessage(frame)
local args = frame.args
local pargs = (frame:getParent() or {}).args
local arguments = {}
for k, v in pairs(pargs) do
local n = tonumber(k) or 0
if (n >= 2) then
arguments[n - 1] = mw.text.trim(v)
end
end
local msg = mw.message.new(mw.text.trim(args[1]), arguments)
local lang
if args.lang and args.lang ~= '' and mw.language.isValidCode(args.lang) then
lang = args.lang
else
lang = mw.getCurrentFrame():preprocess('{{PAGELANGUAGE}}')
end
if (msg:exists() and not msg:isDisabled()) or lang == 'qqx' then
local msgstr = msg:inLanguage(lang):plain()
return frame:preprocess(msgstr)
else
return args.missing ~= ''
and args.missing
or '⧼' .. args[1] .. '⧽'
end
end
return this
df08b6e37cb71c2e424e1b878fb84c4c2a9c1d5b
Module:JSON
828
86
188
187
2022-01-07T08:26:01Z
TheSink
2
1 revision imported
Scribunto
text/plain
-- -*- coding: utf-8 -*-
--
-- Copyright 2010-2012 Jeffrey Friedl
-- http://regex.info/blog/
--
local VERSION = 20111207.5 -- version history at end of file
local OBJDEF = { VERSION = VERSION }
--
-- Simple JSON encoding and decoding in pure Lua.
-- http://www.json.org/
--
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local lua_value = JSON:decode(raw_json_text)
--
-- local raw_json_text = JSON:encode(lua_table_or_value)
-- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability
--
--
-- DECODING
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local lua_value = JSON:decode(raw_json_text)
--
-- If the JSON text is for an object or an array, e.g.
-- { "what": "books", "count": 3 }
-- or
-- [ "Larry", "Curly", "Moe" ]
--
-- the result is a Lua table, e.g.
-- { what = "books", count = 3 }
-- or
-- { "Larry", "Curly", "Moe" }
--
--
-- The encode and decode routines accept an optional second argument, "etc", which is not used
-- during encoding or decoding, but upon error is passed along to error handlers. It can be of any
-- type (including nil).
--
-- With most errors during decoding, this code calls
--
-- JSON:onDecodeError(message, text, location, etc)
--
-- with a message about the error, and if known, the JSON text being parsed and the byte count
-- where the problem was discovered. You can replace the default JSON:onDecodeError() with your
-- own function.
--
-- The default onDecodeError() merely augments the message with data about the text and the
-- location if known (and if a second 'etc' argument had been provided to decode(), its value is
-- tacked onto the message as well), and then calls JSON.assert(), which itself defaults to Lua's
-- built-in assert(), and can also be overridden.
--
-- For example, in an Adobe Lightroom plugin, you might use something like
--
-- function JSON:onDecodeError(message, text, location, etc)
-- LrErrors.throwUserError("Internal Error: invalid JSON data")
-- end
--
-- or even just
--
-- function JSON.assert(message)
-- LrErrors.throwUserError("Internal Error: " .. message)
-- end
--
-- If JSON:decode() is passed a nil, this is called instead:
--
-- JSON:onDecodeOfNilError(message, nil, nil, etc)
--
-- and if JSON:decode() is passed HTML instead of JSON, this is called:
--
-- JSON:onDecodeOfHTMLError(message, text, nil, etc)
--
-- The use of the fourth 'etc' argument allows stronger coordination between decoding and error
-- reporting, especially when you provide your own error-handling routines. Continuing with the
-- the Adobe Lightroom plugin example:
--
-- function JSON:onDecodeError(message, text, location, etc)
-- local note = "Internal Error: invalid JSON data"
-- if type(etc) = 'table' and etc.photo then
-- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName')
-- end
-- LrErrors.throwUserError(note)
-- end
--
-- :
-- :
--
-- for i, photo in ipairs(photosToProcess) do
-- :
-- :
-- local data = JSON:decode(someJsonText, { photo = photo })
-- :
-- :
-- end
--
--
--
--
-- DECODING AND STRICT TYPES
--
-- Because both JSON objects and JSON arrays are converted to Lua tables, it's not normally
-- possible to tell which a Lua table came from, or guarantee decode-encode round-trip
-- equivalency.
--
-- However, if you enable strictTypes, e.g.
--
-- JSON = (loadfile "JSON.lua")() --load the routines
-- JSON.strictTypes = true
--
-- then the Lua table resulting from the decoding of a JSON object or JSON array is marked via Lua
-- metatable, so that when re-encoded with JSON:encode() it ends up as the appropriate JSON type.
--
-- (This is not the default because other routines may not work well with tables that have a
-- metatable set, for example, Lightroom API calls.)
--
--
-- ENCODING
--
-- JSON = (loadfile "JSON.lua")() -- one-time load of the routines
--
-- local raw_json_text = JSON:encode(lua_table_or_value)
-- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability
-- On error during encoding, this code calls:
--
-- JSON:onEncodeError(message, etc)
--
-- which you can override in your local JSON object.
--
--
-- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT
--
-- assert
-- onDecodeError
-- onDecodeOfNilError
-- onDecodeOfHTMLError
-- onEncodeError
--
-- If you want to create a separate Lua JSON object with its own error handlers,
-- you can reload JSON.lua or use the :new() method.
--
---------------------------------------------------------------------------
local author = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json), version " .. tostring(VERSION) .. " ]-"
local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray
local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject
function OBJDEF:newArray(tbl)
return setmetatable(tbl or {}, isArray)
end
function OBJDEF:newObject(tbl)
return setmetatable(tbl or {}, isObject)
end
local function unicode_codepoint_as_utf8(codepoint)
--
-- codepoint is a number
--
if codepoint <= 127 then
return string.char(codepoint)
elseif codepoint <= 2047 then
--
-- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8
--
local highpart = math.floor(codepoint / 0x40)
local lowpart = codepoint - (0x40 * highpart)
return string.char(0xC0 + highpart,
0x80 + lowpart)
elseif codepoint <= 65535 then
--
-- 1110yyyy 10yyyyxx 10xxxxxx
--
local highpart = math.floor(codepoint / 0x1000)
local remainder = codepoint - 0x1000 * highpart
local midpart = math.floor(remainder / 0x40)
local lowpart = remainder - 0x40 * midpart
highpart = 0xE0 + highpart
midpart = 0x80 + midpart
lowpart = 0x80 + lowpart
--
-- Check for an invalid character (thanks Andy R. at Adobe).
-- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070
--
if ( highpart == 0xE0 and midpart < 0xA0 ) or
( highpart == 0xED and midpart > 0x9F ) or
( highpart == 0xF0 and midpart < 0x90 ) or
( highpart == 0xF4 and midpart > 0x8F )
then
return "?"
else
return string.char(highpart,
midpart,
lowpart)
end
else
--
-- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx
--
local highpart = math.floor(codepoint / 0x40000)
local remainder = codepoint - 0x40000 * highpart
local midA = math.floor(remainder / 0x1000)
remainder = remainder - 0x1000 * midA
local midB = math.floor(remainder / 0x40)
local lowpart = remainder - 0x40 * midB
return string.char(0xF0 + highpart,
0x80 + midA,
0x80 + midB,
0x80 + lowpart)
end
end
function OBJDEF:onDecodeError(message, text, location, etc)
if text then
if location then
message = string.format("%s at char %d of: %s", message, location, text)
else
message = string.format("%s: %s", message, text)
end
end
if etc ~= nil then
message = message .. " (" .. OBJDEF:encode(etc) .. ")"
end
if self.assert then
self.assert(false, message)
else
assert(false, message)
end
end
OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError
OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError
function OBJDEF:onEncodeError(message, etc)
if etc ~= nil then
message = message .. " (" .. OBJDEF:encode(etc) .. ")"
end
if self.assert then
self.assert(false, message)
else
assert(false, message)
end
end
local function grok_number(self, text, start, etc)
--
-- Grab the integer part
--
local integer_part = text:match('^-?[1-9]%d*', start)
or text:match("^-?0", start)
if not integer_part then
self:onDecodeError("expected number", text, start, etc)
end
local i = start + integer_part:len()
--
-- Grab an optional decimal part
--
local decimal_part = text:match('^%.%d+', i) or ""
i = i + decimal_part:len()
--
-- Grab an optional exponential part
--
local exponent_part = text:match('^[eE][-+]?%d+', i) or ""
i = i + exponent_part:len()
local full_number_text = integer_part .. decimal_part .. exponent_part
local as_number = tonumber(full_number_text)
if not as_number then
self:onDecodeError("bad number", text, start, etc)
end
return as_number, i
end
local function grok_string(self, text, start, etc)
if text:sub(start,start) ~= '"' then
self:onDecodeError("expected string's opening quote", text, start, etc)
end
local i = start + 1 -- +1 to bypass the initial quote
local text_len = text:len()
local VALUE = ""
while i <= text_len do
local c = text:sub(i,i)
if c == '"' then
return VALUE, i + 1
end
if c ~= '\\' then
VALUE = VALUE .. c
i = i + 1
elseif text:match('^\\b', i) then
VALUE = VALUE .. "\b"
i = i + 2
elseif text:match('^\\f', i) then
VALUE = VALUE .. "\f"
i = i + 2
elseif text:match('^\\n', i) then
VALUE = VALUE .. "\n"
i = i + 2
elseif text:match('^\\r', i) then
VALUE = VALUE .. "\r"
i = i + 2
elseif text:match('^\\t', i) then
VALUE = VALUE .. "\t"
i = i + 2
else
local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i)
if hex then
i = i + 6 -- bypass what we just read
-- We have a Unicode codepoint. It could be standalone, or if in the proper range and
-- followed by another in a specific range, it'll be a two-code surrogate pair.
local codepoint = tonumber(hex, 16)
if codepoint >= 0xD800 and codepoint <= 0xDBFF then
-- it's a hi surrogate... see whether we have a following low
local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i)
if lo_surrogate then
i = i + 6 -- bypass the low surrogate we just read
codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16)
else
-- not a proper low, so we'll just leave the first codepoint as is and spit it out.
end
end
VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint)
else
-- just pass through what's escaped
VALUE = VALUE .. text:match('^\\(.)', i)
i = i + 2
end
end
end
self:onDecodeError("unclosed string", text, start, etc)
end
local function skip_whitespace(text, start)
local match_start, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2
if match_end then
return match_end + 1
else
return start
end
end
local grok_one -- assigned later
local function grok_object(self, text, start, etc)
if not text:sub(start,start) == '{' then
self:onDecodeError("expected '{'", text, start, etc)
end
local i = skip_whitespace(text, start + 1) -- +1 to skip the '{'
local VALUE = self.strictTypes and self:newObject { } or { }
if text:sub(i,i) == '}' then
return VALUE, i + 1
end
local text_len = text:len()
while i <= text_len do
local key, new_i = grok_string(self, text, i, etc)
i = skip_whitespace(text, new_i)
if text:sub(i, i) ~= ':' then
self:onDecodeError("expected colon", text, i, etc)
end
i = skip_whitespace(text, i + 1)
local val, new_i = grok_one(self, text, i)
VALUE[key] = val
--
-- Expect now either '}' to end things, or a ',' to allow us to continue.
--
i = skip_whitespace(text, new_i)
local c = text:sub(i,i)
if c == '}' then
return VALUE, i + 1
end
if text:sub(i, i) ~= ',' then
self:onDecodeError("expected comma or '}'", text, i, etc)
end
i = skip_whitespace(text, i + 1)
end
self:onDecodeError("unclosed '{'", text, start, etc)
end
local function grok_array(self, text, start, etc)
if not text:sub(start,start) == '[' then
self:onDecodeError("expected '['", text, start, etc)
end
local i = skip_whitespace(text, start + 1) -- +1 to skip the '['
local VALUE = self.strictTypes and self:newArray { } or { }
if text:sub(i,i) == ']' then
return VALUE, i + 1
end
local text_len = text:len()
while i <= text_len do
local val, new_i = grok_one(self, text, i)
table.insert(VALUE, val)
i = skip_whitespace(text, new_i)
--
-- Expect now either ']' to end things, or a ',' to allow us to continue.
--
local c = text:sub(i,i)
if c == ']' then
return VALUE, i + 1
end
if text:sub(i, i) ~= ',' then
self:onDecodeError("expected comma or '['", text, i, etc)
end
i = skip_whitespace(text, i + 1)
end
self:onDecodeError("unclosed '['", text, start, etc)
end
grok_one = function(self, text, start, etc)
-- Skip any whitespace
start = skip_whitespace(text, start)
if start > text:len() then
self:onDecodeError("unexpected end of string", text, nil, etc)
end
if text:find('^"', start) then
return grok_string(self, text, start, etc)
elseif text:find('^[-0123456789 ]', start) then
return grok_number(self, text, start, etc)
elseif text:find('^%{', start) then
return grok_object(self, text, start, etc)
elseif text:find('^%[', start) then
return grok_array(self, text, start, etc)
elseif text:find('^true', start) then
return true, start + 4
elseif text:find('^false', start) then
return false, start + 5
elseif text:find('^null', start) then
return nil, start + 4
else
self:onDecodeError("can't parse JSON", text, start, etc)
end
end
function OBJDEF:decode(text, etc)
if type(self) ~= 'table' or self.__index ~= OBJDEF then
OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc)
end
if text == nil then
self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc)
elseif type(text) ~= 'string' then
self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc)
end
if text:match('^%s*$') then
return nil
end
if text:match('^%s*<') then
-- Can't be JSON... we'll assume it's HTML
self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc)
end
--
-- Ensure that it's not UTF-32 or UTF-16.
-- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3),
-- but this package can't handle them.
--
if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then
self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc)
end
local success, value = pcall(grok_one, self, text, 1, etc)
if success then
return value
else
-- should never get here... JSON parse errors should have been caught earlier
assert(false, value)
return nil
end
end
local function backslash_replacement_function(c)
if c == "\n" then
return "\\n"
elseif c == "\r" then
return "\\r"
elseif c == "\t" then
return "\\t"
elseif c == "\b" then
return "\\b"
elseif c == "\f" then
return "\\f"
elseif c == '"' then
return '\\"'
elseif c == '\\' then
return '\\\\'
else
return string.format("\\u%04x", c:byte())
end
end
local chars_to_be_escaped_in_JSON_string
= '['
.. '"' -- class sub-pattern to match a double quote
.. '%\\' -- class sub-pattern to match a backslash
.. '%z' -- class sub-pattern to match a null
.. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters
.. ']'
local function json_string_literal(value)
local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function)
return '"' .. newval .. '"'
end
local function object_or_array(self, T, etc)
--
-- We need to inspect all the keys... if there are any strings, we'll convert to a JSON
-- object. If there are only numbers, it's a JSON array.
--
-- If we'll be converting to a JSON object, we'll want to sort the keys so that the
-- end result is deterministic.
--
local string_keys = { }
local seen_number_key = false
local maximum_number_key
for key in pairs(T) do
if type(key) == 'number' then
seen_number_key = true
if not maximum_number_key or maximum_number_key < key then
maximum_number_key = key
end
elseif type(key) == 'string' then
table.insert(string_keys, key)
else
self:onEncodeError("can't encode table with a key of type " .. type(key), etc)
end
end
if seen_number_key and #string_keys > 0 then
--
-- Mixed key types... don't know what to do, so bail
--
self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc)
elseif #string_keys == 0 then
--
-- An array
--
if seen_number_key then
return nil, maximum_number_key -- an array
else
--
-- An empty table...
--
if tostring(T) == "JSON array" then
return nil
elseif tostring(T) == "JSON object" then
return { }
else
-- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects
return nil
end
end
else
--
-- An object, so return a list of keys
--
table.sort(string_keys)
return string_keys
end
end
--
-- Encode
--
local encode_value -- must predeclare because it calls itself
function encode_value(self, value, parents, etc)
if value == nil then
return 'null'
end
if type(value) == 'string' then
return json_string_literal(value)
elseif type(value) == 'number' then
if value ~= value then
--
-- NaN (Not a Number).
-- JSON has no NaN, so we have to fudge the best we can. This should really be a package option.
--
return "null"
elseif value >= math.huge then
--
-- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should
-- really be a package option. Note: at least with some implementations, positive infinity
-- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is.
-- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">="
-- case first.
--
return "1e+9999"
elseif value <= -math.huge then
--
-- Negative infinity.
-- JSON has no INF, so we have to fudge the best we can. This should really be a package option.
--
return "-1e+9999"
else
return tostring(value)
end
elseif type(value) == 'boolean' then
return tostring(value)
elseif type(value) ~= 'table' then
self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc)
else
--
-- A table to be converted to either a JSON object or array.
--
local T = value
if parents[T] then
self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc)
else
parents[T] = true
end
local result_value
local object_keys, maximum_number_key = object_or_array(self, T, etc)
if maximum_number_key then
--
-- An array...
--
local ITEMS = { }
for i = 1, maximum_number_key do
table.insert(ITEMS, encode_value(self, T[i], parents, etc))
end
result_value = "[" .. table.concat(ITEMS, ",") .. "]"
elseif object_keys then
--
-- An object
--
--
-- We'll always sort the keys, so that comparisons can be made on
-- the results, etc. The actual order is not particularly
-- important (e.g. it doesn't matter what character set we sort
-- as); it's only important that it be deterministic... the same
-- every time.
--
local PARTS = { }
for _, key in ipairs(object_keys) do
local encoded_key = encode_value(self, tostring(key), parents, etc)
local encoded_val = encode_value(self, T[key], parents, etc)
table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val))
end
result_value = "{" .. table.concat(PARTS, ",") .. "}"
else
--
-- An empty array/object... we'll treat it as an array, though it should really be an option
--
result_value = "[]"
end
parents[T] = false
return result_value
end
end
local encode_pretty_value -- must predeclare because it calls itself
function encode_pretty_value(self, value, parents, indent, etc)
if type(value) == 'string' then
return json_string_literal(value)
elseif type(value) == 'number' then
return tostring(value)
elseif type(value) == 'boolean' then
return tostring(value)
elseif type(value) == 'nil' then
return 'null'
elseif type(value) ~= 'table' then
self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc)
else
--
-- A table to be converted to either a JSON object or array.
--
local T = value
if parents[T] then
self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc)
end
parents[T] = true
local result_value
local object_keys = object_or_array(self, T, etc)
if not object_keys then
--
-- An array...
--
local ITEMS = { }
for i = 1, #T do
table.insert(ITEMS, encode_pretty_value(self, T[i], parents, indent, etc))
end
result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]"
else
--
-- An object -- can keys be numbers?
--
local KEYS = { }
local max_key_length = 0
for _, key in ipairs(object_keys) do
local encoded = encode_pretty_value(self, tostring(key), parents, "", etc)
max_key_length = math.max(max_key_length, #encoded)
table.insert(KEYS, encoded)
end
local key_indent = indent .. " "
local subtable_indent = indent .. string.rep(" ", max_key_length + 2 + 4)
local FORMAT = "%s%" .. tostring(max_key_length) .. "s: %s"
local COMBINED_PARTS = { }
for i, key in ipairs(object_keys) do
local encoded_val = encode_pretty_value(self, T[key], parents, subtable_indent, etc)
table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val))
end
result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}"
end
parents[T] = false
return result_value
end
end
function OBJDEF:encode(value, etc)
if type(self) ~= 'table' or self.__index ~= OBJDEF then
OBJDEF:onEncodeError("JSON:encode must be called in method format", etc)
end
local parents = {}
return encode_value(self, value, parents, etc)
end
function OBJDEF:encode_pretty(value, etc)
local parents = {}
local subtable_indent = ""
return encode_pretty_value(self, value, parents, subtable_indent, etc)
end
function OBJDEF.__tostring()
return "JSON encode/decode package"
end
OBJDEF.__index = OBJDEF
function OBJDEF:new(args)
local new = { }
if args then
for key, val in pairs(args) do
new[key] = val
end
end
return setmetatable(new, OBJDEF)
end
return OBJDEF:new()
--
-- Version history:
--
-- 20111207.5 Added support for the 'etc' arguments, for better error reporting.
--
-- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent.
--
-- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules:
--
-- * When encoding lua for JSON, Sparse numeric arrays are now handled by
-- spitting out full arrays, such that
-- JSON:encode({"one", "two", [10] = "ten"})
-- returns
-- ["one","two",null,null,null,null,null,null,null,"ten"]
--
-- In 20100810.2 and earlier, only up to the first non-null value would have been retained.
--
-- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999".
-- Version 20100810.2 and earlier created invalid JSON in both cases.
--
-- * Unicode surrogate pairs are now detected when decoding JSON.
--
-- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding
--
-- 20100731.1 initial public release
--
cb2c3d084de7f3f42a582991115e86de7740d004
Module:LangSwitch
828
87
190
189
2022-01-07T08:26:02Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[[
__ __ _ _ _ ____ _ _ _
| \/ | ___ __| |_ _| | ___ _| | __ _ _ __ __ _/ ___|_ _(_) |_ ___| |__
| |\/| |/ _ \ / _` | | | | |/ _ (_) | / _` | '_ \ / _` \___ \ \ /\ / / | __/ __| '_ \
| | | | (_) | (_| | |_| | | __/_| |__| (_| | | | | (_| |___) \ V V /| | || (__| | | |
|_| |_|\___/ \__,_|\__,_|_|\___(_)_____\__,_|_| |_|\__, |____/ \_/\_/ |_|\__\___|_| |_|
|___/
Authors and maintainers:
* User:Zolo - original version in Module:Fallback
* User:Jarekt
]]
-- add optional module
-- used for debugging purposes as it detects cases of unintended global variables
require('Module:No globals')
local p = {}
--[[
_langSwitch
This function is the core part of the LangSwitch template.
Example usage from Lua:
text = _langSwitch({en='text in english', pl='tekst po polsku'}, lang)
Parameters:
args - table with translations by language
lang - desired language (often user's native language)
Error Handling:
]]
function p._langSwitch(args, lang) -- args: table of translations
-- Return error if there is not default and no english version
if not args.en and not args.default then
local err = '<b class="error">LangSwitch Error: no default</b>'
if args.nocat == '1' then
return err
else
return err .. '[[Category:LangSwitch template without default version]]'
end
end
-- To improve performance try quick switch, and load fallback chain only if needed.
-- In the vast majority of cases fast switch is sufficient
local val = args[lang]
if val == '~' then
return ''
elseif val and val ~= '' then
return val
elseif args.quick then
return nil
end
-- get the list of accepetable language (lang + those in lang's fallback chain) and check their content
assert(lang, 'LangSwitch Error: no lang')
local langList = mw.language.getFallbacksFor(lang)
table.insert(langList,1,lang)
table.insert(langList,math.max(#langList,2),'default')
for _, language in ipairs(langList) do
val = args[language]
if val == '~' then
return ''
elseif val and val ~= '' then
return val
end
end
end
--[[
langSwitch
This function is the core part of the LangSwitch template.
Example Usage from a template:
{{#invoke:fallback|langSwitch|en=text in english|pl=tekst po polsku|lang={{int:lang}} }}
Parameters:
frame.args - table with translations by language
frame.args.lang - desired language (often user's native language)
Error Handling:
]]
function p.langSwitch(frame) -- version to be used from wikitext
local args = frame.args
-- if no expected args provided than check parent template/module args
if args.en==nil and args.default==nil and args.nocat==nil then
args = mw.getCurrentFrame():getParent().args
end
local lang = args.lang
if not lang or not mw.language.isKnownLanguageTag(lang) then
lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
-- Try quick switch which checks the most likely option when fallback is not needed
args.quick = true;
local val = p._langSwitch(args, lang)
if val then
return val
end
-- Allow input in format: {{LangSwitch|de=Grün|es/it/pt=Verde|fr=Vert|en=Green |lang=en}}
-- with multiple languages mapping to a single value
local args1 = {}
for name, value in pairs( args ) do
if value ~= '' and type(name)=='string' then
for str in string.gmatch( name, "([^/]+)" ) do
args1[str] = value
end
end
end
return p._langSwitch(args1, lang)
end
return p
8c558e084bad5823fd7dc21c4cbc2ce5a6c0e95d
Module:URLutil
828
88
192
191
2022-01-07T08:26:03Z
TheSink
2
1 revision imported
Scribunto
text/plain
--[=[ URLutil 2013-08-09
Utilities for URL etc. on www.
* getURIScheme()
* getAuthority()
* getHost()
* getPort()
* getScheme()
* getTLD()
* getTop2domain()
* getTop3domain()
* isAuthority()
* isDomain()
* isDomainExample()
* isHost()
* isIP()
* isIPlocal()
* isIPv4()
* isIPv6()
* isMailAddress()
* isMailLink()
* isProtocolMW()
* isProtocolDialog()
* isProtocolWiki()
* isResourceURL()
* isSuspiciousURL()
* isUnescapedURL()
* isWebURL()
* wikiEscapeURL()
Only [[dotted decimal]] notation for IPv4 supported.
Does not support dotted hexadecimal, dotted octal, or single-number formats.
IPv6 URL (bracketed) not yet implemented; might need Wikintax escaping anyway.
]=]
-- table for export
local URLutil = {}
URLutil.getURIScheme = function ( uri )
if type( uri ) == "string" then
local prot, colon, slashes = uri:match( "^%s*([a-zA-Z]*)(:?)(/?/?)" )
if #colon == 1 and #prot >= 2 then
return prot:lower()
elseif #slashes == 2 and #prot == 0 then
return "//"
end
end
return false
end -- getURIScheme()
local getTopDomain = function ( url, mode )
local host = URLutil.getHost( url )
if host then
local pattern = "[%w%%]+%.[a-z][a-z]+)$"
if mode == 3 then
pattern = "[%w%%]+%." .. pattern
end
host = mw.ustring.match( "." .. host, "%.(" .. pattern )
if host then
return host
end
end
return false
end -- getTopDomain()
URLutil.getAuthority = function ( url )
if type( url ) == "string" then
local host, colon, port = mw.ustring.match( url .. "/", "^%s*%w*:?//([%w%.%%-]+)(:?)([%d]*)/" )
if URLutil.isHost( host ) then
host = mw.ustring.lower( host )
if colon == ":" then
if port:find( "^[1-9]" ) then
return ( host .. ":" .. port )
end
elseif #port == 0 then
return host
end
end
end
return false
end -- URLutil.getAuthority()
URLutil.getHost = function ( url )
local auth = URLutil.getAuthority( url )
if auth then
return mw.ustring.match( auth, "^([%w%.%%-]+):?[%d]*$" )
end
return false
end -- URLutil.getHost()
URLutil.getPort = function ( url )
url = URLutil.getAuthority( url )
if url then
url = url:match( ":([1-9][0-9]*)$" )
if type( url ) == "string" then
return tonumber( url )
end
end
return false
end -- URLutil.getPort()
URLutil.getScheme = function ( url )
if type( url ) == "string" then
local prot, colon, slashes = url:match( "^%s*([a-zA-Z]*)(:?)(//)" )
if slashes == "//" then
if colon == ":" then
if #prot > 2 then
return prot:lower() .. "://"
end
elseif #prot == 0 then
return "//"
end
end
end
return false
end -- URLutil.getScheme()
URLutil.getTLD = function ( url )
local host = URLutil.getHost( url )
if host then
host = mw.ustring.match( host, "[%w]+%.([a-z][a-z]+)$" )
return host or false
end
return false
end -- URLutil.getTLD()
URLutil.getTop2domain = function ( url )
return getTopDomain( url, 2 )
end -- URLutil.getTop2domain()
URLutil.getTop3domain = function ( url )
return getTopDomain( url, 3 )
end -- URLutil.getTop3domain()
URLutil.isAuthority = function ( s )
if type( s ) == "string" then
local host, colon, port = mw.ustring.match( s, "^%s*([%w%.%%-]+)(:?)(%d*)%s*$" )
if colon == ":" then
port = port:match( "^[1-9][0-9]*$" )
if type( port ) ~= "string" then
return false
end
elseif port ~= "" then
return false
end
return URLutil.isHost( host )
end
return false
end -- URLutil.isAuthority()
URLutil.isDomain = function ( s )
if type( s ) == "string" then
s = mw.ustring.match( s, "^%s*([%w%.%%-]+%w)%.[a-zA-Z][a-zA-Z]+%s*$" )
if type( s ) == "string" then
if mw.ustring.find( s, "^%w" ) then
if mw.ustring.find( s, "..", 1, true ) then
return false
else
return true
end
end
end
end
return false
end -- URLutil.isDomain()
URLutil.isDomainExample = function ( url )
-- RFC 2606: example.com example.net example.org example.edu
local r = getTopDomain( url, 2 )
if r then
local s = r:lower():match( "^example%.([a-z][a-z][a-z])$" )
if s then
r = ( s == "com" or
s == "edu" or
s == "net" or
s == "org" )
else
r = false
end
end
return r
end -- URLutil.isDomainExample()
URLutil.isHost = function ( s )
return URLutil.isDomain( s ) or URLutil.isIP( s )
end -- URLutil.isHost()
URLutil.isIP = function ( s )
return URLutil.isIPv4( s ) and 4 or URLutil.isIPv6( s ) and 6
end -- URLutil.isIP()
URLutil.isIPlocal = function ( s )
-- IPv4 according to RFC 1918, RFC 1122; even any 0.0.0.0 (RFC 5735)
local r = false
local num = s:match( "^ *([01][0-9]*)%." )
if num then
num = tonumber( num )
if num == 0 then
r = s:match( "^ *0+%.[0-9]+%.[0-9]+%.[0-9]+ *$" )
elseif num == 10 or num == 127 then
-- loopback; private/local host: 127.0.0.1
r = URLutil.isIPv4( s )
elseif num == 169 then
-- 169.254.*.*
elseif num == 172 then
-- 172.(16...31).*.*
num = s:match( "^ *0*172%.([0-9]+)%." )
if num then
num = tonumber( num )
if num >= 16 and num <= 31 then
r = URLutil.isIPv4( s )
end
end
elseif beg == 192 then
-- 192.168.*.*
num = s:match( "^ *0*192%.([0-9]+)%." )
if num then
num = tonumber( num )
if num == 168 then
r = URLutil.isIPv4( s )
end
end
end
end
if r then
r = true
end
return r
end -- URLutil.isIPlocal()
URLutil.isIPv4 = function ( s )
local function legal( n )
return ( tonumber( n ) < 256 )
end
if type( s ) == "string" then
local p1, p2, p3, p4 = s:match( "^%s*([1-9][0-9]?[0-9]?)%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%s*$" )
if p1 and p2 and p3 and p4 then
return legal( p1 ) and legal( p2 ) and legal( p3 ) and legal( p4 )
end
end
return false
end -- URLutil.isIPv4()
URLutil.isIPv6 = function ( s )
local dcolon, groups
if type( s ) ~= "string"
or s:len() == 0
or s:find( "[^:%x]" ) -- only colon and hex digits are legal chars
or s:find( "^:[^:]" ) -- can begin or end with :: but not with single :
or s:find( "[^:]:$" )
or s:find( ":::" )
then
return false
end
s = mw.text.trim( s )
s, dcolon = s:gsub( "::", ":" )
if dcolon > 1 then
return false
end -- at most one ::
s = s:gsub( "^:?", ":" ) -- prepend : if needed, upper
s, groups = s:gsub( ":%x%x?%x?%x?", "" ) -- remove valid groups, and count them
return ( ( dcolon == 1 and groups < 8 ) or
( dcolon == 0 and groups == 8 ) )
and ( s:len() == 0 or ( dcolon == 1 and s == ":" ) ) -- might be one dangling : if original ended with ::
end -- URLutil.isIPv6()
URLutil.isMailAddress = function ( s )
if type( s ) == "string" then
s = mw.ustring.match( s, "^%s*[%w%.%%_-]+@([%w%.%%-]+)%s*$" )
return URLutil.isDomain( s )
end
return false
end -- URLutil.isMailAddress()
URLutil.isMailLink = function ( s )
if type( s ) == "string" then
local addr
s, addr = mw.ustring.match( s, "^%s*([Mm][Aa][Ii][Ll][Tt][Oo]):(%S[%w%.%%_-]*@[%w%.%%-]+)%s*$" )
if type( s ) == "string" then
if s:lower() == "mailto" then
return URLutil.isMailAddress( addr )
end
end
end
return false
end -- URLutil.isMailLink()
local function isProtocolAccepted( prot, supplied )
if type( prot ) == "string" then
local scheme, colon, slashes = mw.ustring.match( prot, "^%s*([a-zA-Z]*)(:?)(/?/?)%s*$" )
if slashes ~= "/" then
if scheme == "" then
if colon ~= ":" and slashes == "//" then
return true
end
elseif colon == ":" or slashes == "" then
local s = supplied:match( " " .. scheme:lower() .. " " )
if type( s ) == "string" then
return true
end
end
end
end
return false
end -- isProtocolAccepted()
URLutil.isProtocolMW = function ( prot )
return isProtocolAccepted( prot,
" http https ftp ftps ssh sftp irc ircs xmpp sip sips gopher telnet nntp worldwind mailto tel sms news svn git mms bitcoin magnet urn geo " )
end -- URLutil.isProtocolMW()
URLutil.isProtocolDialog = function ( prot )
return isProtocolAccepted( prot, " mailto irc ircs ssh telnet " )
end -- URLutil.isProtocolDialog()
URLutil.isProtocolWiki = function ( prot )
return isProtocolAccepted( prot,
" ftp ftps git http https nntp sftp svn worldwind " )
end -- URLutil.isProtocolWiki()
URLutil.isResourceURL = function ( url )
local scheme = URLutil.getScheme( url )
if scheme then
local s = " // http:// https:// ftp:// "
s = s:find( " " .. scheme .. " " )
if s then
if URLutil.getAuthority( url ) then
if not url:match( "%S%s+%S" ) then
return true
end
end
end
end
return false
end -- URLutil.isResourceURL()
URLutil.isSuspiciousURL = function ( url )
if URLutil.isResourceURL( url ) then
local s = URLutil.getAuthority( url )
local pat = "[%[|%]" ..
mw.ustring.char( 8201, 45, 8207, 8234, 45, 8239, 8288 )
.. "]"
if s:find( "@" )
or url:find( "''" )
or url:find( pat )
or url:find( "[%.,]$" ) then
return true
end
-- TODO zero width character ??
return false
end
return true
end -- URLutil.isSuspiciousURL()
URLutil.isUnescapedURL = function ( url, trailing )
if type( trailing ) ~= "string" then
if URLutil.isWebURL( url ) then
if url:match( "[%[|%]]" ) then
return true
end
end
end
return false
end -- URLutil.isUnescapedURL()
URLutil.isWebURL = function ( url )
if URLutil.getScheme( url ) and URLutil.getAuthority( url ) then
if not url:match( "%S%s+%S" ) then
return true
end
end
return false
end -- URLutil.isWebURL()
URLutil.wikiEscapeURL = function ( url )
if url:find( "[%[|%]]" ) then
local n
url, n = url:gsub( "%[", "[" )
:gsub( "|", "|" )
:gsub( "%]", "]" )
end
return url
end -- URLutil.wikiEscapeURL()
-- Provide template access and expose URLutil table to require
local p = {}
function p.getURIScheme( frame )
return URLutil.getURIScheme( frame.args[ 1 ] ) or ""
end
function p.getAuthority( frame )
return URLutil.getAuthority( frame.args[ 1 ] ) or ""
end
function p.getHost( frame )
return URLutil.getHost( frame.args[ 1 ] ) or ""
end
function p.getPort( frame )
return URLutil.getPort( frame.args[ 1 ] ) or ""
end
function p.getScheme( frame )
return URLutil.getScheme( frame.args[ 1 ] ) or ""
end
function p.getTLD( frame )
return URLutil.getTLD( frame.args[ 1 ] ) or ""
end
function p.getTop2domain( frame )
return URLutil.getTop2domain( frame.args[ 1 ] ) or ""
end
function p.getTop3domain( frame )
return URLutil.getTop3domain( frame.args[ 1 ] ) or ""
end
function p.isAuthority( frame )
return URLutil.isAuthority( frame.args[ 1 ] ) and "1" or ""
end
function p.isDomain( frame )
return URLutil.isDomain( frame.args[ 1 ] ) and "1" or ""
end
function p.isDomainExample( frame )
return URLutil.isDomainExample( frame.args[ 1 ] ) and "1" or ""
end
function p.isHost( frame )
return URLutil.isHost( frame.args[ 1 ] ) and "1" or ""
end
function p.isIP( frame )
return URLutil.isIP( frame.args[ 1 ] ) or ""
end
function p.isIPlocal( frame )
return URLutil.isIPlocal( frame.args[ 1 ] ) and "1" or ""
end
function p.isIPv4( frame )
return URLutil.isIPv4( frame.args[ 1 ] ) and "1" or ""
end
function p.isIPv6( frame )
return URLutil.isIPv6( frame.args[ 1 ] ) and "1" or ""
end
function p.isMailAddress( frame )
return URLutil.isMailAddress( frame.args[ 1 ] ) and "1" or ""
end
function p.isMailLink( frame )
return URLutil.isMailLink( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolMW( frame )
return URLutil.isProtocolMW( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolDialog( frame )
return URLutil.isProtocolDialog( frame.args[ 1 ] ) and "1" or ""
end
function p.isProtocolWiki( frame )
return URLutil.isProtocolWiki( frame.args[ 1 ] ) and "1" or ""
end
function p.isResourceURL( frame )
return URLutil.isResourceURL( frame.args[ 1 ] ) and "1" or ""
end
function p.isSuspiciousURL( frame )
return URLutil.isSuspiciousURL( frame.args[ 1 ] ) and "1" or ""
end
function p.isUnescapedURL( frame )
return URLutil.isUnescapedURL( frame.args[ 1 ], frame.args[ 2 ] ) and "1" or ""
end
function p.isWebURL( frame )
return URLutil.isWebURL( frame.args[ 1 ] ) and "1" or ""
end
function p.wikiEscapeURL( frame )
return URLutil.wikiEscapeURL( frame.args[ 1 ] )
end
function p.URLutil()
return URLutil
end
return p
dee7f13cff878a48fa5ee79e162a4ca2e1454c8d
MediaWiki:Lang
8
89
194
193
2022-01-07T08:28:05Z
TheSink
2
1 revision imported
wikitext
text/x-wiki
en
094b0fe0e302854af1311afab85b5203ba457a3b
User:TheSink
2
18
195
27
2022-01-07T08:55:50Z
TheSink
2
Test clickable button
wikitext
text/x-wiki
Hello! I'm a CVRF developer and owner of this wiki. You can contact me on Discord at ''The_Sink#4096''.
{{Clickable button|Test|Test}}
69eb686bd4184d6a771d079151442667ea5a4abd
File:20210702 154606657.png
6
6
196
6
2022-01-07T13:16:13Z
Lule34567
6
Added caption
wikitext
text/x-wiki
A picture of Sector E's transit station
5308fa31de5f5d0a089f3f21d9ce591209d664db
Talk:Main Page
1
20
197
47
2022-01-07T13:26:18Z
Lule34567
6
Starting to create the discussion page
wikitext
text/x-wiki
== Welcome To The Discussion Page! ==
Here, You'll find links to some built-in IRC chats as well as our discord server in order to discuss things about the wiki. We'll also feature some IRC chats from MediaWiki, the open source wiki creator being used currently in conjunction with Miraheze. We thank you for opting in to join and check out one of our Chats and hope you have fun!
Note: Wiki [[Rules]] Apply.
08ee3060faa2fbe8cb4c48dfde72b2db2979a19f
198
197
2022-01-07T13:41:19Z
Lule34567
6
/* Welcome To The Discussion Page! */
wikitext
text/x-wiki
== Welcome To The Discussion Page! ==
Here, You'll find links to some built-in IRC chats as well as our discord server in order to discuss things about the wiki. We'll also feature some IRC chats from MediaWiki, the open source wiki creator being used currently in conjunction with Miraheze. We thank you for opting in to join and check out one of our Chats and hope you have fun!
Note: Wiki [[Rules]] Apply.
{| class="wikitable"
|+ Links for IRC and Discord Chats
|-
! Link !! Name !! Use
|-
| [https://widget.mibbit.com/?settings=8ad8f5784276a2539aaaf330fa3ccb6c&server=irc.mibbit.net%3A%2B6697&channel=%23CVRF_Wiki Link] || #CVRF-Wiki || General channel for any chat relating to this wiki.
|-
| [https://discord.gg/ytBqnKN Link] || Our Official Discord || Our Official Discord server used by all our users.
|-
| [https://web.libera.chat/?channel=#mediawiki Link] || #mediawiki || MediaWiki's Official General IRC Chat.
| [https://web.libera.chat/?channel=#wikimedia-dev Link] || #wikimedia-dev || WikiMedia's IRC for Developers.
|-
| [https://web.libera.chat/?channel=#wikimedia-tech Link] || #wikimedia-tech || The IRC for Technical Help for MediaWiki
|}
ac024f878c76cf47d222c15e3c186756bbe4ed77
209
198
2022-01-07T16:53:31Z
AyScorch
5
Someone doesn't get wiki talk pages.
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
212
209
2022-01-07T18:35:56Z
Lule34567
6
wikitext
text/x-wiki
Oops!
It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki!
We are working as hard as we can in order to make this possible so hold on tight!
Sincerely, Parzival
--Lule34567 (talk) 05:23, 7 January 2022 (UTC)
53e366948000df05184f7f4a81b0943d1f8d52d0
Main Page
0
1
199
51
2022-01-07T14:56:49Z
Lule34567
6
Added parentheses to image contribution caption
wikitext
text/x-wiki
__NOTOC__
== Welcome to the CVRF Wiki!==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the JKR Research Facility (JKRF) from 2015 to 2017 and also as the Hyptek Research Facility (HTRF) from 2017 to 2019 until it was changed back to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of version '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]] and [[Contribution Hub]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
e72db4cb51716e58cfb147dfd3f72f89264b12c4
211
199
2022-01-07T18:14:16Z
ChromeEight
7
Bold
wikitext
text/x-wiki
__NOTOC__
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) from 2015 to 2017 and also as the '''Hyptek Research Facility''' (HTRF) from 2017 to 2019 until it was changed back to its current name and branding.
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta''' '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
=== Community & Useful Links ===
Before editing or creating new content on this wiki, please read over the [[Rules]] and [[Contribution Hub]]!
[https://discord.gg/ytBqnKN Join our Discord server]
[https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline Check the project tracker]
=== Useful Pages ===
[[Facility Locations]]
84693b8a83f78a42ffd8dd73c56479ac863a1d7f
Contribution Hub
0
21
200
50
2022-01-07T15:03:56Z
Lule34567
6
Added Useful Links
wikitext
text/x-wiki
'''<big>Welcome to the Contribution Hub!</big>'''
'''<big>Please Note: This page is Work in Progress! Please do not expect any information here to be done, fixed, or corrected yet!</big>'''
Welcome User!
Here you'll find some tips and tricks for making, editing or contributing to pages! Currently this page is WIP, but at the moment, you can browse the rest of wiki and maybe make some minor edits to get started on your volunteer job! Be careful though, all your edits and contributions are logged in [[https://wiki.jkr.productions/w/index.php?title=Main_Page&action=history|the edit history]] so make sure to not violate any rules!
Rules for contributing can be found here: https://wiki.jkr.productions/wiki/Rules
Thanks for coming by and we can't wait to see your new impacts!
=== Useful Links: ===
[https://m.mediawiki.org/wiki/Help:VisualEditor/User_guide User Guide]
[https://www.mediawiki.org/w/index.php?title=VisualEditor:Test&veaction=edit Visual Editor Simulation]
[[Rules]]
{{DEFAULTSORT:Contribution_HubWIP}}
86ff7ad117238f3cdf3478bedd9a815b280dbcdf
213
200
2022-01-07T18:45:17Z
Lule34567
6
Changed title to say that its WIP
wikitext
text/x-wiki
{{DISPLAYTITLE:Contribution Hub (WIP)}}
'''<big>Welcome to the Contribution Hub!</big>'''
'''<big>Please Note: This page is Work in Progress! Please do not expect any information here to be done, fixed, or corrected yet!</big>'''
Welcome User!
Here you'll find some tips and tricks for making, editing or contributing to pages! Currently this page is WIP, but at the moment, you can browse the rest of wiki and maybe make some minor edits to get started on your volunteer job! Be careful though, all your edits and contributions are logged in [[https://wiki.jkr.productions/w/index.php?title=Main_Page&action=history|the edit history]] so make sure to not violate any rules!
Rules for contributing can be found here: https://wiki.jkr.productions/wiki/Rules
Thanks for coming by and we can't wait to see your new impacts!
=== Useful Links: ===
[https://m.mediawiki.org/wiki/Help:VisualEditor/User_guide User Guide]
[https://www.mediawiki.org/w/index.php?title=VisualEditor:Test&veaction=edit Visual Editor Simulation]
[[Rules]]
{{DEFAULTSORT:Contribution_HubWIP}}
71a188ffdd847423aabc5c1cf378f6ac7d37317e
CVRF Wiki:Copyrights
4
92
203
2022-01-07T15:15:13Z
Lule34567
6
Created page with "== Copyright Information == Currently, all information within this wiki falls under Fair Use and is under the license of CC-BY-NC-ND. MediaWiki is made by Wikipedia and The Wikipedia Foundation. Miraheze is a public wiki creator in conjunction with MediaWiki and falls under the license of CC-BY-SA. Creative Common info below This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. [[File:CC-BY-NC-ND.png|thumb]]..."
wikitext
text/x-wiki
== Copyright Information ==
Currently, all information within this wiki falls under Fair Use and is under the license of CC-BY-NC-ND. MediaWiki is made by Wikipedia and The Wikipedia Foundation. Miraheze is a public wiki creator in conjunction with MediaWiki and falls under the license of CC-BY-SA.
Creative Common info below
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
[[File:CC-BY-NC-ND.png|thumb]]
Miraheze is a work licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
[[File:CC BY-SA 4.0. .png|thumb]]
2e6a1f200f5bfd2d4930d519e524aeb38b7ed067
204
203
2022-01-07T15:35:09Z
TheSink
2
Protected "[[CVRF Wiki:Copyrights]]": Important copyright info ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
== Copyright Information ==
Currently, all information within this wiki falls under Fair Use and is under the license of CC-BY-NC-ND. MediaWiki is made by Wikipedia and The Wikipedia Foundation. Miraheze is a public wiki creator in conjunction with MediaWiki and falls under the license of CC-BY-SA.
Creative Common info below
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
[[File:CC-BY-NC-ND.png|thumb]]
Miraheze is a work licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
[[File:CC BY-SA 4.0. .png|thumb]]
2e6a1f200f5bfd2d4930d519e524aeb38b7ed067
206
204
2022-01-07T15:39:13Z
TheSink
2
Correct copyright info
wikitext
text/x-wiki
Currently, content on the CVRF Wiki is licensed under the [<tvar|cc>https://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 License</>] unless specified otherwise.
7bf26855a2d270ed893c2577fdb804c11d7a0d0f
207
206
2022-01-07T15:41:30Z
TheSink
2
Fix broken link
wikitext
text/x-wiki
Currently, content on the CVRF Wiki is licensed under the [https://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 License] unless specified otherwise.
7844b6667fe918ab135c0b79805770928f9310d5
File:Actual CC-BY-SA 4.0.png
6
93
205
2022-01-07T15:37:15Z
Lule34567
6
wikitext
text/x-wiki
For use in CVRF_Wiki: Copyright
2bbbfd721763fc8603418d7d8370bf5042921ac4
CVRF Wiki talk:Copyrights
5
94
208
2022-01-07T15:41:47Z
Lule34567
6
Created page with "#REDIRECT Talk:Main Page"
wikitext
text/x-wiki
#REDIRECT [[Talk:Main Page]
2bbbc47a90381e9c43dd7378c58628497ce79a6f
210
208
2022-01-07T17:03:08Z
AyScorch
5
Cleaning
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
User:Lule34567
2
19
214
33
2022-01-07T18:51:01Z
Lule34567
6
Added more to biography
wikitext
text/x-wiki
Lule34567, also named Parzival, is a 2016 Roblox user who has played JKRF since before the removal of trains. He was also nicknamed "The Mechanic" back then as he used to fix the trains becoming stuck using only a crowbar. Surprisingly, this worked but took some time in order to fix. Later, He was reunited with JKRF in 2020. A couple months after that, he was given a role during a limited time event for becoming a Forbidden Reactor Supporter which was a miniature reactor with a triangular shape but then got stripped of it after being banned for being underaged. He now resides in the server as a sort of "veteran" of JKRF and holds that role gladly. His current age is 13.
If needed, you may contact me at robertson3736@gmail.com.
Thank you.
c9378aa6c7625f0467df60c0afd8e3e00f2bc60f
File:Old reception lobby.png
6
95
215
2022-01-07T19:00:22Z
ChromeEight
7
wikitext
text/x-wiki
The Reception Lobby in a preserved build of JKRF Beta 0.7.x.
03727504fffd5f2cea9a1ce80b7d2a2985624670
File:Reception lobby 11.png
6
96
216
2022-01-07T19:46:03Z
ChromeEight
7
wikitext
text/x-wiki
The Reception Lobby shown in a development build for Beta 0.11, also known as the Locomotive Update.
384389e40c97bee2cde654ef713759b676ca48d9
File:Reception lobby 15.png
6
97
217
2022-01-07T19:47:49Z
ChromeEight
7
wikitext
text/x-wiki
The Reception Lobby in Beta 0.15.
9ac9853f128bb7fccb74cc49be5ed5ac529cf7d7
File:Reception lobby really old.png
6
98
218
2022-01-07T19:56:40Z
ChromeEight
7
wikitext
text/x-wiki
old
c00dbbc9dadfbe1e232e93a729dd4752fade0abf
Reception lobby
0
15
219
22
2022-01-07T20:23:45Z
ChromeEight
7
Added history/timeline
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Reception lobby 15.png|frameless|right|The reception area in the upcoming Beta 0.15 update.]]
The '''Reception Lobby''' is a location on [[Level 5]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
== History ==
[[File:Reception lobby really old.png|thumb|left|The reception lobby in early Beta 0.7.]]
[[File:Reception lobby 11.png|thumb|left|The reception area in a dev build for Beta 0.11.]]
=== Beta 0.7 ===
In JKRF Beta 0.7, part of the office-themed administration area on Level 4 was carved out into a reception lobby with a few rows of waiting benches. It was initially intended as a joke where people can wait for the long-delayed release and opening of the Pinewood Oil Platform, another JKR game in development at the time.
Offices for high-ranking JKR administration members were originally located adjacent to the Reception Lobby, which were later replaced by a conference room.
=== Beta 0.9 ===
The redesign of the [[Atrium]] in Beta 0.9 added an upper level to the Atrium at the same level as the Reception Lobby, providing access between the reception area and the Atrium. New benches were also added around this time.
=== Beta 0.12 ===
During the Foundation Update, a second level was added to the lab hallways, which changed the Atrium upper level to Level 5. As a result, the floor level that the Reception Lobby is located at was also changed to Level 5. In this update, the administration area's hallway colors were made more brown, with the Reception Lobby alongside it.
=== ''Beta 0.15'' ===
Additional plants and some trash bins will be added in the upcoming Beta 0.15 update.
[[Category:Locations]]
c94ef065cf1fda3fc694ff651238cb3142b766cd
User:ChromeEight
2
99
220
2022-01-07T20:44:08Z
Lule34567
6
trolled chrome
wikitext
text/x-wiki
he likes pies
9a56db8ddf65aeecb06ed330d94e50c57c320e0e
221
220
2022-01-07T20:44:48Z
ChromeEight
7
wikitext
text/x-wiki
hi im chrome, seven ate nine
20d694aec132366ce2d0dd2b0498fd60086df42b
User:ChromeEight
2
99
222
221
2022-01-07T20:46:56Z
Lule34567
6
fixed
wikitext
text/x-wiki
hi im chrome, seven ate nine
note from lule: he's also a furry and a femboy
08f4a4219919a39bb275ee94088873d82dec0dd8
223
222
2022-01-07T20:48:17Z
ChromeEight
7
Reverted edits by [[Special:Contributions/Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) to last revision by [[User:ChromeEight|ChromeEight]]
wikitext
text/x-wiki
hi im chrome, seven ate nine
20d694aec132366ce2d0dd2b0498fd60086df42b
228
223
2022-01-08T04:12:17Z
Lule34567
6
wikitext
text/x-wiki
hi im chrome, seven ate nine. ten doesn't exist. six is my step-sister.
stink
7b36afb80e1bbb6d9c8b6ec0eccf8640c550cd0a
267
228
2022-01-10T18:36:51Z
Lule34567
6
added riddle
wikitext
text/x-wiki
hi im chromeEight, seven ate nine. ten doesn't exist. six is my step-sister. and eleven divorced five. who is eleven?
stink
9198d1f9a8e9a37daa8929381c496e14e4c0c9cf
User talk:ChromeEight
3
100
224
2022-01-07T20:56:16Z
Lule34567
6
added comment
wikitext
text/x-wiki
== trolling chrome's profile ==
first come first serve. this is my land. I have 90,000 hours logged in the CVRF Wiki, I know as many formatting tricks as god himself, I have 50,000 pages created and 400,000 edits, I will write an entire wiki page for your house being bombed by pakistan and make sure your family knows your dead for. I will continuously screw around in your profile and make sure you're always next.
p.s. this is a joke please don't ban me :(
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 20:56, 7 January 2022 (UTC)
278260297d0074dbe2c08569bb70d68001a08d21
226
224
2022-01-07T21:02:48Z
AyScorch
5
it better be a joke
wikitext
text/x-wiki
== trolling chrome's profile ==
first come first serve. this is my land. I have 90,000 hours logged in the CVRF Wiki, I know as many formatting tricks as god himself, I have 50,000 pages created and 400,000 edits, I will write an entire wiki page for your house being bombed by pakistan and make sure your family knows your dead for. I will continuously screw around in your profile and make sure you're always next.
p.s. this is a joke please don't ban me :(
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 20:56, 7 January 2022 (UTC)
: it better be a joke [[User:AyScorch|Scorch]] ([[User talk:AyScorch|talk]]) 21:02, 7 January 2022 (UTC)
c6cbf933655a13cfd86baa242da205f8d5abe0e7
227
226
2022-01-08T04:09:36Z
Lule34567
6
/* trolling chrome's profile */
wikitext
text/x-wiki
== trolling chrome's profile ==
first come first serve. this is my land. I have 90,000 hours logged in the CVRF Wiki, I know as many formatting tricks as god himself, I have 50,000 pages created and 400,000 edits, I will write an entire wiki page for your house being bombed by pakistan and make sure your family knows your dead for. I will continuously screw around in your profile and make sure you're always next.
p.s. this is a joke please don't ban me :(
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 20:56, 7 January 2022 (UTC)
: it better be a joke [[User:AyScorch|Scorch]] ([[User talk:AyScorch|talk]]) 21:02, 7 January 2022 (UTC)
:: I can change your bio in a minutes pass. --[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 04:09, 8 January 2022 (UTC)
66f521e9250122930c0dc6fbac19a1f9a771a741
User:AyScorch
2
17
225
66
2022-01-07T20:56:22Z
AyScorch
5
updating things
wikitext
text/x-wiki
Hi! I'm Scorch, current holder of the 666 counting role in the discord server. <s>I identify as a nuclear fusion reactor</s> I am male and go by he/him.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|AyScorch
|-
|Discord
|@AyScorch#2022
|-
|YouTube
|AyScorch
|-
|Email•
|aryschorch@gmail.com
|}
''• Rarely check. Please use Discord when possible.''
A chair is a piece of furniture with a raised surface supported by legs, commonly used to seat a single person.
4e92b4293a34ba0a5c36f4ca0a7e2a3034da6957
Main Page
0
1
229
211
2022-01-08T04:14:19Z
TheSink
2
Edit layout and content of main page slightly
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first.
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta''' '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
9ca440f4d711fdd7573142e3a2a53f3c49eb3c65
230
229
2022-01-08T04:19:09Z
TheSink
2
Add a bit of info about the facility design/layout
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first.
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta''' '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
4691ecd1563fdbeb7a7a18fb99addcd61c85b667
250
230
2022-01-08T18:49:32Z
Lule34567
6
Added comment
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first. <!-- Someone edit in a sentence in CVRF_Wiki: Disclaimers about how being a Contributor will NOT give you any credit or roles in-game or in the discord server. Being a Wiki Contributor is a volunteering job and specifically says that on the main Wikipedia page when you sign up as a contributor. Also if you think this is dumb, ask someone with below 70 IQ. -->
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta''' '''0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
65e63d69482ecdb8731b07b9b9b7bd587d3648e3
263
250
2022-01-10T13:19:08Z
ChromeEight
7
/* Version Info */ changed version formatting
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first. <!-- Someone edit in a sentence in CVRF_Wiki: Disclaimers about how being a Contributor will NOT give you any credit or roles in-game or in the discord server. Being a Wiki Contributor is a volunteering job and specifically says that on the main Wikipedia page when you sign up as a contributor. Also if you think this is dumb, ask someone with below 70 IQ. -->
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 14.1'''. Development of '''Beta 15.0''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
6eb81a203de9078a2f816f31b09b1cd1ee5b764c
File:Contingency Unit Location.png
6
101
231
2022-01-08T06:09:18Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Contingency Unit.png
6
102
232
2022-01-08T06:21:12Z
TheSink
2
wikitext
text/x-wiki
Screenshot of the Contingency Unit
fad10e373ed4669cdb5551e80fb00dc80bbf4ca4
Panic Rush
0
103
233
2022-01-08T06:30:58Z
TheSink
2
Create page on the Panic Rush minigame
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear to beep in a progressively rapid manner, immediately followed by confetti and spinning text saying "''you lose lol''". This easter egg is meant to subvert expectations by creating a fast paced suspense followed by the reveal that there is no real danger, and tries to be light-hearted in this reveal with the confetti and comic sans font.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into Sector A (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be bruteforced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password Hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
51afa2c2a9efe31b085a1384c6332b810b8e6d67
234
233
2022-01-08T06:34:55Z
TheSink
2
Minor grammatical corrections, addition of Easter eggs category
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password Hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
[[Category:Easter eggs]]
0415234a3a41d54faae5d02491ffc90f7cef11e0
235
234
2022-01-08T06:40:18Z
TheSink
2
Extremely small grammatical correction
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance when combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password Hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
[[Category:Easter eggs]]
451d08cbe08a5cfc234a5ffb4669643679a75fe8
252
235
2022-01-08T19:48:04Z
AyScorch
5
added most of gameplay
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance when combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password Hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
== Gameplay ==
[[File:PanicRushHUD.png|thumb|The HUD that is shown during Panic Rush]]
When activated, a message in chat states that the CVRF self destruction mechanism was activated and to cancel it, you would need to press all of the [[Panic Switch|Panic Stations]] within 138 seconds and that the timer will begin shortly. After waiting a few seconds, all of the stations are marked with orange octagons, which turn green then fade out when that station has been activated. The time and current number of panic switches are displayed in a Payday-like HUD on the right of the screen. When the timer hits zero if the panic switches aren't fully pressed, a scene is shown showing an area in Sublevel 5 saying the room is Contingency Room Alpha. A red border grows on screen, then suddenly vanish when the bomb says "you lost lol". The chat message reflects this and also says that it was an easter egg.
[[Category:Easter eggs]]
77ea1d3ce9b36645e9baed359e41022cceef84f9
253
252
2022-01-09T01:23:33Z
TheSink
2
Update wording of Gameplay section, add a tiny bit more detail
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance when combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password Hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
== Gameplay ==
[[File:PanicRushHUD.png|thumb|The HUD that is shown during Panic Rush]]
When activated, a message in chat states that the CVRF self destruct mechanism has been triggered and to cancel it, you would need to press all of the [[Panic Switch|Panic Stations]] within 138 seconds once the sequence begins. After waiting a few seconds, all of the stations are marked with orange octagons to guide players in the right direction. The time and number of panic stations pressed are displayed in a ''[https://en.wikipedia.org/wiki/Payday_2 Payday 2]''-like HUD on the top right corner of the screen. When a panic station is pressed, the orange octagon highlighting its location will turn green and fade away. When the timer hits zero, and if not all panic stations have been pressed, a scene is shown to all players in an area of [[Sublevel 5]] labelled "''Contingency Room Alpha''". A red border grows on-screen alongside the beep of a bomb in the center of the room, slowly increasing in pace. A few seconds later, the border will disappear and the beeping will stop, along with a confetti effect and spinning Comic Sans text saying "''you lost lol"''. The chat message reflects this and clarifies the scenario was simply an easter egg.
[[Category:Easter eggs]]
__FORCETOC__
86cca244cdc7cbf8ddb65233b8a2a13559640285
254
253
2022-01-09T01:27:08Z
TheSink
2
Capitalization correction
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic Switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance when combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo Bay]], in the southwestern corner
* In the [[Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Sector D Cafeteria]]
== Gameplay ==
[[File:PanicRushHUD.png|thumb|The HUD that is shown during Panic Rush]]
When activated, a message in chat states that the CVRF self destruct mechanism has been triggered and to cancel it, you would need to press all of the [[Panic Switch|Panic Stations]] within 138 seconds once the sequence begins. After waiting a few seconds, all of the stations are marked with orange octagons to guide players in the right direction. The time and number of panic stations pressed are displayed in a ''[https://en.wikipedia.org/wiki/Payday_2 Payday 2]''-like HUD on the top right corner of the screen. When a panic station is pressed, the orange octagon highlighting its location will turn green and fade away. When the timer hits zero, and if not all panic stations have been pressed, a scene is shown to all players in an area of [[Sublevel 5]] labelled "''Contingency Room Alpha''". A red border grows on-screen alongside the beep of a bomb in the center of the room, slowly increasing in pace. A few seconds later, the border will disappear and the beeping will stop, along with a confetti effect and spinning Comic Sans text saying "''you lost lol"''. The chat message reflects this and clarifies the scenario was simply an easter egg.
[[Category:Easter eggs]]
__FORCETOC__
e8ba245be3d51c53c796fd8f1527c7dd9a540332
Talk:Panic Rush
1
104
236
2022-01-08T06:41:34Z
TheSink
2
Created page with "To-do for now: Explain how the minigame plays out and mention a brief history (when it was added to the game, how it has changed since then) ~~~~"
wikitext
text/x-wiki
To-do for now: Explain how the minigame plays out and mention a brief history (when it was added to the game, how it has changed since then) [[User:TheSink|TheSink]] ([[User talk:TheSink|talk]]) 06:41, 8 January 2022 (UTC)
c2cfaf9792ad606ab0e384b8e2fcf93f4294957f
237
236
2022-01-08T06:42:02Z
TheSink
2
wikitext
text/x-wiki
To-do for now: Explain how the minigame plays out and mention a brief history (when it was added to the game, how it has changed since then) - [[User:TheSink|TheSink]] ([[User talk:TheSink|talk]]) 06:41, 8 January 2022 (UTC)
9c164efb2d5813610c686f7b1db71425ce3d53ca
238
237
2022-01-08T06:43:33Z
TheSink
2
wikitext
text/x-wiki
To-do for now: Explain how the minigame plays out and mention a brief history (when it was added to the game, how it has changed since then), and add reference to the music that plays during the scenario - [[User:TheSink|TheSink]] ([[User talk:TheSink|talk]]) 06:41, 8 January 2022 (UTC)
bad1fb99f4a275e090c5891498e90ed99fdec954
Panic switch
0
105
239
2022-01-08T07:00:18Z
AyScorch
5
Panic Switch
wikitext
text/x-wiki
{{Page under construction}}
== Appearance ==
Panic Switches appear as two yellow objects hung on the wall, on a gray plate. One of the objects appear like a fire pull station but with the text being replaced with "PANIC", "PULL TO ALERT SECURITY".
0a77795c0b0d3c789668c308d3a5bc2ddbd7c5ae
Rules
0
5
240
70
2022-01-08T13:59:26Z
ChromeEight
7
/* Contributing */ Added MoS and behavior rules
wikitext
text/x-wiki
== Manual of Style ==
* This wiki uses American English grammar and spelling rules. Proper grammar will not be strongly enforced, but it is best to make all content as comprehendible as possible for the sake of readability.
=== Dates ===
* Use MM/DD/YYYY or MM/DD format.
** Examples: January 8, 2022 or January 8
=== Page names ===
* All page names should be in [https://en.wikipedia.org/wiki/Letter_case#Sentence_case sentence case].
** Examples: Reception lobby, Group history, Contribution rules, Development history
== Contributing ==
* This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
* Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. Not safe for work (NSFW) or inappropriate content will result in a ban.
* Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
* Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
** Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
** Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
** Pages about removed or cancelled features ([[Template:Content removed]])
** Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
* You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
* Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
* It is highly encouraged to leave an edit summary after editing pages for transparency and edit history navigation purposes.
* Developers have the final say on any content on the wiki. As such, you should not re-add any content that may be removed by a developer if there is a given reason for its removal.
== Behavior ==
* Creating alternate accounts is discouraged.
* Do not leave spam or vandalize any pages, including user pages and talk pages.
** This includes blanking pages, removing entire sections without a justified reason, or changing parts of the page into jokes.
* Please be civil on talk pages. Always leave constructive criticism and be clear on what aspects should be improved upon. Inappropriate behavior will result in a ban.
c8477550b4fcc1887908e3f55cf2b89a3f3e40e9
241
240
2022-01-08T14:02:18Z
ChromeEight
7
Additional rules
wikitext
text/x-wiki
== Manual of Style ==
This wiki uses American English grammar and spelling rules. Proper grammar will not be strongly enforced, but it is best to make all content as comprehendible as possible for the sake of readability.
=== Dates ===
Use MM/DD/YYYY or MM/DD format.
* Examples: January 8, 2022 or January 8
=== Page names ===
All page names should be in [https://en.wikipedia.org/wiki/Letter_case#Sentence_case sentence case].
* Examples: Reception lobby, Group history, Contribution rules, Development history
== Contributing ==
* This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
* Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. Not safe for work (NSFW) or inappropriate content will result in a ban.
* Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
* Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
** Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
** Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
** Pages about removed or cancelled features ([[Template:Content removed]])
** Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
=== Etiquette ===
* You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
* Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
* It is highly encouraged to leave an edit summary after editing pages for transparency and edit history navigation purposes.
* Moderator and developers have the final say on any content on the wiki. As such, you should not re-add any content that may be removed by a moderator or developer if there is a given reason for its removal.
== Behavior ==
* Creating alternate accounts is discouraged.
* Do not leave spam or vandalize any pages, including user pages and talk pages.
** This includes blanking pages, removing entire sections without a justified reason, or changing parts of the page into jokes.
* Please be civil on talk pages. Always leave constructive criticism and be clear on what aspects should be improved upon. Inappropriate behavior will result in a ban.
18806b8c113e068bdaf6f7fdbda64b54d6615fa0
268
241
2022-01-11T05:07:06Z
ChromeEight
7
/* Behavior */ grammar fix
wikitext
text/x-wiki
== Manual of Style ==
This wiki uses American English grammar and spelling rules. Proper grammar will not be strongly enforced, but it is best to make all content as comprehendible as possible for the sake of readability.
=== Dates ===
Use MM/DD/YYYY or MM/DD format.
* Examples: January 8, 2022 or January 8
=== Page names ===
All page names should be in [https://en.wikipedia.org/wiki/Letter_case#Sentence_case sentence case].
* Examples: Reception lobby, Group history, Contribution rules, Development history
== Contributing ==
* This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
* Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. Not safe for work (NSFW) or inappropriate content will result in a ban.
* Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
* Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
** Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
** Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
** Pages about removed or cancelled features ([[Template:Content removed]])
** Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
=== Etiquette ===
* You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
* Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
* It is highly encouraged to leave an edit summary after editing pages for transparency and edit history navigation purposes.
* Moderator and developers have the final say on any content on the wiki. As such, you should not re-add any content that may be removed by a moderator or developer if there is a given reason for its removal.
== Behavior ==
* Creating alternate accounts is discouraged.
* Do not vandalize or leave spam on any pages, including user pages and talk pages.
** This includes blanking pages, removing entire sections without a justified reason, or changing parts of the page into jokes.
* Please be civil on talk pages. Always leave constructive criticism and be clear on what aspects should be improved upon. Inappropriate behavior will result in a ban.
5e8257b979f998a397e9fd5943f88dd1e9a7cf7f
269
268
2022-01-11T05:36:05Z
ChromeEight
7
/* Manual of Style */ Added version numbering
wikitext
text/x-wiki
== Manual of Style ==
This wiki uses American English grammar and spelling rules. Proper grammar will not be strongly enforced, but it is best to make all content as comprehendible as possible for the sake of readability.
=== Game versions ===
When referring to a specific version of the game, it is best to refer to its update name or the development phase with its version number, as follows:
* Examples: The Foundation Update or Beta 0.12
* Example: In Beta 0.12, the Atrium...
* Example: The facility was remodeled during The Foundation Update.
=== Dates ===
Use MM/DD/YYYY or MM/DD format.
* Examples: January 8, 2022 or January 8
=== Page names ===
All page names should be in [https://en.wikipedia.org/wiki/Letter_case#Sentence_case sentence case].
* Examples: Reception lobby, Group history, Contribution rules, Development history
== Contributing ==
* This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
* Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. Not safe for work (NSFW) or inappropriate content will result in a ban.
* Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
* Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
** Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
** Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
** Pages about removed or cancelled features ([[Template:Content removed]])
** Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
=== Etiquette ===
* You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
* Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
* It is highly encouraged to leave an edit summary after editing pages for transparency and edit history navigation purposes.
* Moderator and developers have the final say on any content on the wiki. As such, you should not re-add any content that may be removed by a moderator or developer if there is a given reason for its removal.
== Behavior ==
* Creating alternate accounts is discouraged.
* Do not vandalize or leave spam on any pages, including user pages and talk pages.
** This includes blanking pages, removing entire sections without a justified reason, or changing parts of the page into jokes.
* Please be civil on talk pages. Always leave constructive criticism and be clear on what aspects should be improved upon. Inappropriate behavior will result in a ban.
bd5ea7805d0b56d861b5c15d8173159596d0872a
Reception lobby
0
15
242
219
2022-01-08T14:15:22Z
ChromeEight
7
/* History */ Added mention of ceiling turret
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Reception lobby 15.png|frameless|right|The reception area in the upcoming Beta 0.15 update.]]
The '''Reception Lobby''' is a location on [[Level 5]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
== History ==
[[File:Reception lobby really old.png|thumb|left|The reception lobby in early Beta 0.7.]]
[[File:Reception lobby 11.png|thumb|left|The reception area in a dev build for Beta 0.11.]]
=== Beta 0.7 ===
In JKRF Beta 0.7, part of the office-themed administration area on Level 4 was carved out into a reception lobby with a few rows of waiting benches. It was initially intended as a joke where people can wait for the long-delayed release and opening of the Pinewood Oil Platform, another JKR game in development at the time.
Offices for high-ranking JKR administration members were originally located adjacent to the Reception Lobby, which were later replaced by a conference room. A ceiling turret was also formerly located in the reception lobby, which was removed in a later update.
=== Beta 0.9 ===
The redesign of the [[Atrium]] in Beta 0.9 added an upper level to the Atrium at the same level as the Reception Lobby, providing access between the reception area and the Atrium. New benches were also added around this time.
=== Beta 0.12 ===
During the Foundation Update, a second level was added to the lab hallways, which changed the Atrium upper level to Level 5. As a result, the floor level that the Reception Lobby is located at was also changed to Level 5. In this update, the administration area's hallway colors were made more brown, with the Reception Lobby alongside it.
=== ''Beta 0.15'' ===
Additional plants and some trash bins will be added in the upcoming Beta 0.15 update.
[[Category:Locations]]
195989fbcc29a48ba5c4058ea4334b5412c385ed
Development history
0
106
243
2022-01-08T15:25:51Z
ChromeEight
7
Added history from Taiga
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== The Lost Potential (Late 2014 - April 2015) ==
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
== The Concept (April-May 2015) ==
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
== The First Steps (May-November 2015) ==
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the Food Labs, which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
== Team Building (November 2015 - February 2017) ==
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
== Back and Forth (February 2017 - April 2018) ==
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
== Under New Management (April 2018 - January 2019) ==
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
== The Pandemical Revival (May 2020 - present) ==
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
''To be continued...''
9b9f710f198aefced33dab8d08cf98f409d9269e
244
243
2022-01-08T15:29:10Z
ChromeEight
7
/* The First Steps (May-November 2015) */ Added Food Labs hyperlink
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== The Lost Potential (Late 2014 - April 2015) ==
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
== The Concept (April-May 2015) ==
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
== The First Steps (May-November 2015) ==
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
== Team Building (November 2015 - February 2017) ==
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
== Back and Forth (February 2017 - April 2018) ==
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
== Under New Management (April 2018 - January 2019) ==
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
== The Pandemical Revival (May 2020 - present) ==
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
''To be continued...''
49f1591445bb3834cbf2e8f5ee8ea9f1e7457921
245
244
2022-01-08T15:30:33Z
ChromeEight
7
Changed subheaders
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - present) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
''To be continued...''
bb5036915581e178b142a2f979d6cf910649113c
List of current and former developers
0
107
246
2022-01-08T16:21:01Z
ChromeEight
7
Added names
wikitext
text/x-wiki
This is a complete list of all current and former developers of JKR Productions that have worked on the Cobalt Valley Research Facility and its iterations.
== Current developers ==
{| class="wikitable"
|+ Caption text
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| ChromeEight || Game creator, level design, programmer, graphic design || 2015-2018, 2020-present || [[User:ChromeEight|ChromeEight]]
|-
| The_Sink || Level design, programmer, graphic design, backend systems, external systems || 2016-2018, 2020-present || [[User:The_Sink|The_Sink]]
|-
| LouieK22 || Programmer, backend systems, framework creator, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShoesForClues || Model design, programmer, backend systems, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShipMaster_Caine || Programmer, model design || 2021-present (inactive) || N/A
|}
== Former developers ==
{| class="wikitable"
|+ Caption text
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| lavafactory || Model design, level design, graphic design || 2016-2018, 2020-2021 || N/A
|-
| Architect_Build || Model design, level design || 2017-2018 || N/A
|-
| xUsagi || Model design || 2017-2018 || N/A
|-
| nathanpn || Level design, model design || 2017-2018 || N/A
|-
| TheCakeChicken || Programmer, backend systems || 2018-2019 || N/A
|-
| systemise || Programmer || 2018 || N/A
|-
| Kezzera || Model design || 2018 || N/A
|}
6c963ea1abfc0f5254f5752d2e1655c05ee5d9d6
249
246
2022-01-08T17:51:27Z
ChromeEight
7
remove caption text
wikitext
text/x-wiki
This is a complete list of all current and former developers of JKR Productions that have worked on the Cobalt Valley Research Facility and its iterations.
== Current developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| ChromeEight || Game creator, level design, programmer, graphic design || 2015-2018, 2020-present || [[User:ChromeEight|ChromeEight]]
|-
| The_Sink || Level design, programmer, graphic design, backend systems, external systems || 2016-2018, 2020-present || [[User:The_Sink|The_Sink]]
|-
| LouieK22 || Programmer, backend systems, framework creator, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShoesForClues || Model design, programmer, backend systems, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShipMaster_Caine || Programmer, model design || 2021-present (inactive) || N/A
|}
== Former developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| lavafactory || Model design, level design, graphic design || 2016-2018, 2020-2021 || N/A
|-
| Architect_Build || Model design, level design || 2017-2018 || N/A
|-
| xUsagi || Model design || 2017-2018 || N/A
|-
| nathanpn || Level design, model design || 2017-2018 || N/A
|-
| TheCakeChicken || Programmer, backend systems || 2018-2019 || N/A
|-
| systemise || Programmer || 2018 || N/A
|-
| Kezzera || Model design || 2018 || N/A
|}
794677158f6b7d488e22417162fa1ce8674b1691
264
249
2022-01-10T13:30:43Z
ChromeEight
7
Protected "[[List of current and former developers]]": Official information provided by development team ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
This is a complete list of all current and former developers of JKR Productions that have worked on the Cobalt Valley Research Facility and its iterations.
== Current developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| ChromeEight || Game creator, level design, programmer, graphic design || 2015-2018, 2020-present || [[User:ChromeEight|ChromeEight]]
|-
| The_Sink || Level design, programmer, graphic design, backend systems, external systems || 2016-2018, 2020-present || [[User:The_Sink|The_Sink]]
|-
| LouieK22 || Programmer, backend systems, framework creator, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShoesForClues || Model design, programmer, backend systems, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShipMaster_Caine || Programmer, model design || 2021-present (inactive) || N/A
|}
== Former developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| lavafactory || Model design, level design, graphic design || 2016-2018, 2020-2021 || N/A
|-
| Architect_Build || Model design, level design || 2017-2018 || N/A
|-
| xUsagi || Model design || 2017-2018 || N/A
|-
| nathanpn || Level design, model design || 2017-2018 || N/A
|-
| TheCakeChicken || Programmer, backend systems || 2018-2019 || N/A
|-
| systemise || Programmer || 2018 || N/A
|-
| Kezzera || Model design || 2018 || N/A
|}
794677158f6b7d488e22417162fa1ce8674b1691
Food Labs
0
108
247
2022-01-08T16:48:22Z
ChromeEight
7
Created page
wikitext
text/x-wiki
The '''Food Labs''' was a laboratory located on Level 2. It was the first lab ever added to the game and was suggested by user Shredder914.
The lab contained several tables and a machine that would produce synthetic bananas onto a conveyor belt and subsequently incinerate them. A broom was kept on the wall in the event that the synthetic bananas spilled out of the conveyor belt.
An unofficial preserved copy of the Food Labs can be found [https://www.roblox.com/games/1932480100/The-Food-Lab-from-HTRF-0-11 here].
== Development history ==
In Alpha and early Beta builds, the Food Labs was located along a hallway between the Atrium staircase and the hallway fork going to the looped hallway towards the other labs on Level 2.
When the [[Atrium]] and lab hallways were redesigned in Beta 0.8, the Food Labs was moved to the Blue Hallway as the sole lab in the Food Science nook. However, in Beta 0.11, the Food Labs was removed from the game in an effort to clean up the lab lineup in the facility.
6691e6dd1a105230f150e1db1cb1b2296204060e
Atrium
0
109
248
2022-01-08T17:42:16Z
ChromeEight
7
Added history and levels
wikitext
text/x-wiki
The Atrium is the central hub of the facility, spanning several levels and connecting multiple hallways.
== Development history ==
The Atrium was added sometime between Beta 0.5 and Beta 0.6, when Levels 3 and 4 were added to the game. It was an high-ceiling area on Level 3 connected to staircases to and from the laboratories on Level 2 and the administrative areas on Level 3. A cafeteria was added, which was accessible via the Atrium. A turret was also located at the center of the Atrium ceiling.
In Beta 0.9, the Atrium was completely redesigned and divided into distinct levels at Level 1, 2, and 3, with a close resemblance to Vaults found in the games ''Fallout 3'' and ''Fallout: New Vegas''. In this redesign, the Atrium staircase was redesigned and divided, wherein the staircase to Level 3 was relocated to the east side, while the staircase to Level 1 remained at the north side.
With the labs being at the same level as the Atrium, the south side of the Atrium provided access to the Blue and Orange lab hallways. An emergency access door to and from the Orange Hallway was located at the base of the Atrium staircase to Level 3.
In Beta 0.11, the Cafeteria was relocated from Level 2 to Level 3, now being located on the former location of the Control Room. As a result, the Control Room was subsequently relocated northwest of the Atrium, with access being provided by the west side of the upper Atrium. This allowed both sides of the Atrium to be mirrored.
In the Foundation Update, the Blue and Orange lab hallways were redesigned as Sector C West and Sector C East, respectively, each with two levels of laboratories and other rooms. As a result, the Atrium was slightly raised, and the upper level was reclassified as Level 5, while the lower level was reclassified as Level 3. The Atrium ceiling was also slightly raised.
In the Recursive Update, the hallway leading to the Control Room was merged into the Sector D hallway. A disco easter egg was also added.
== Levels ==
=== Level 1 ===
The lowest level of the Atrium is a dark area with catwalks that provide access to the facility sublevel. This level of the Atrium is connected to the Geothermal Sublevel Station of the Transit System. It is currently in the process of dismantling its former reactor infrastructure.
=== Level 3 ===
The middle level of the Atrium is an open area connected to the Atrium staircase for Level 2 and Level 5, the Atrium Lounge, and a janitor's closet. It also connects to a nook located in between the Atrium restrooms, providing access to Sector C West and Sector C East.
=== Level 5 ===
The highest level of the Atrium on this level consists of a U-shaped hallway overlooking the Level 3 Atrium, which branches out into the Control Room, the Atrium staircase, the Security Area, the [[Reception Lobby (location)|Reception Lobby]], and the Cafeteria.
d48b369db13d654119c8a84dfed98d80c6f629f5
File:PanicRushHUD.png
6
110
251
2022-01-08T19:35:03Z
AyScorch
5
wikitext
text/x-wiki
The HUD that is shown during Panic Rush.
d76bb9c0ee91b8e67154647a4de287b02f6298e9
Module:Format link
828
151
351
2022-01-09T02:48:07Z
en>Hike395
0
incorrect entry point
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) and (not title.exists) then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
b1a3177dc2ec780dc0a9720bfb64058aed46db95
Facility Locations
0
16
255
32
2022-01-09T08:22:45Z
AyScorch
5
Added link to Atrium
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 3 and 4 and houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*Cafeteria
*Freight Checkpoint
*Topside Stairwell
*Tram Station 3
*Infirmary
*Living Quarters
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
d335465bd6b9a7457a4d2a57be7ad1924c8955c8
259
255
2022-01-10T04:21:59Z
TheSink
2
Add link to Cafeteria page
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 3 and 4 and houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
===Sector C East Labs===
#Headcrab Parasitology Lab
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*Tram Station 3
*Infirmary
*Living Quarters
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
f00cc2cdf17cfa3999fb297293b27d4b2a304497
Category:Locations
14
111
256
2022-01-10T03:51:14Z
TheSink
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Talk:Main Page
1
20
257
212
2022-01-10T04:15:45Z
TheSink
2
wikitext
text/x-wiki
Test [[User:TheSink|TheSink]] ([[User talk:TheSink|talk]]) 04:15, 10 January 2022 (UTC)
Oops!
It seems as if this page doesn't exist yet or has encountered an error we're currently fixing! Currently, this pages purpose is supposed to be conversations among users about the central page for the wiki!
We are working as hard as we can in order to make this possible so hold on tight!
Sincerely, Parzival
--Lule34567 (talk) 05:23, 7 January 2022 (UTC)
dbca1b15d8445ffea32d11b8a70d78badefece76
Cafeteria
0
112
258
2022-01-10T04:20:26Z
TheSink
2
Add cafeteria page
wikitext
text/x-wiki
{{Page under construction}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
1fc6e2a1df9c4c9de4adfc9acf82cfb6b3f0c31a
260
258
2022-01-10T04:23:43Z
TheSink
2
Add WIP notice to Cafeteria page
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
ca4ba5da8fd6bc1536bfe01e0a9c5e5e47bd83a4
261
260
2022-01-10T04:27:08Z
TheSink
2
Add Locations category to Cafeteria page
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
[[Category:Locations]]
9083eb6a09dd8d7d52ba219c7633c9671ded2de1
CVRF Wiki:General disclaimer
4
113
262
2022-01-10T12:42:03Z
Lule34567
6
Added Disclaimer
wikitext
text/x-wiki
== Current Disclaimers: ==
=== Updated 1/10/21 (mm/dd/yy) ===
* Contributors are volunteers. They are not paid and they will not be featured in in-game credits.
5960e62eb6d2eb43b88c6338ef54e6d783c3da1d
Category talk:Pages with ignored display titles
15
115
266
2022-01-10T18:32:37Z
Lule34567
6
added comment
wikitext
text/x-wiki
MUHAHAHAHA, I COPIED AND PASTED THE ENTIRE BEE MOVIE SCRIPT ONTO THIS DEAD PAGE WHICH NOBODY ACTUALLY USES. i actually might just use it for myself. this is now my home.
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 18:32, 10 January 2022 (UTC)
5d2df4614ec20c0bb6aec6a8d22184e7ff93a650
MediaWiki:Common.css
8
10
270
13
2022-01-12T06:10:27Z
TheSink
2
Import Wikipedia Common.css
css
text/css
/* Reset italic styling set by user agent */
cite,
dfn {
font-style: inherit;
}
/* Straight quote marks for <q> */
q {
quotes: '"' '"' "'" "'";
}
/* Avoid collision of blockquote with floating elements by swapping margin and padding */
blockquote {
overflow: hidden;
margin: 1em 0;
padding: 0 40px;
}
/* Consistent size for <small>, <sub> and <sup> */
small {
font-size: 85%;
}
.mw-body-content sub,
.mw-body-content sup,
span.reference /* for Parsoid */ {
font-size: 80%;
}
/* Same spacing for indented and unindented paragraphs on talk pages */
.ns-talk .mw-body-content dd {
margin-top: 0.4em;
margin-bottom: 0.4em;
}
/* Main page fixes */
#interwiki-completelist {
font-weight: bold;
}
/* Reduce page jumps by hiding collapsed/dismissed content */
.client-js .mw-special-Watchlist #watchlist-message,
.client-js .collapsible:not( .mw-made-collapsible).collapsed > tbody > tr:not(:first-child),
/* Hide charinsert base for those not using the gadget */
#editpage-specialchars {
display: none;
}
/* Adds padding above Watchlist announcements where new recentchanges/watchlist filters are enabled */
.mw-rcfilters-enabled .mw-specialpage-summary {
margin-top: 1em;
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
background-color: rgba(0, 127, 255, 0.133);
}
/* Styling for citations. Breaks long urls, etc., rather than overflowing box */
.citation {
word-wrap: break-word;
}
/* Make the list of references smaller
* Keep in sync with Template:Refbegin/styles.css
* And Template:Reflist/styles.css
*/
ol.references {
font-size: 90%;
margin-bottom: 0.5em;
}
/* Style for horizontal lists (separator following item).
@source mediawiki.org/wiki/Snippets/Horizontal_lists
@revision 8 (2016-05-21)
@author [[User:Edokter]]
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
margin: 0; /* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again */
display: inline;
}
/* Display nested lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* Generate interpuncts */
.hlist dt:after {
content: ": ";
}
/**
* Note hlist style usage differs in Minerva and is defined in core as well!
* Please check Minerva desktop (and Minerva.css) when changing
* See https://phabricator.wikimedia.org/T213239
*/
.hlist dd:after,
.hlist li:after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child:before,
.hlist dd dt:first-child:before,
.hlist dd li:first-child:before,
.hlist dt dd:first-child:before,
.hlist dt dt:first-child:before,
.hlist dt li:first-child:before,
.hlist li dd:first-child:before,
.hlist li dt:first-child:before,
.hlist li li:first-child:before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child:after,
.hlist dd dt:last-child:after,
.hlist dd li:last-child:after,
.hlist dt dd:last-child:after,
.hlist dt dt:last-child:after,
.hlist dt li:last-child:after,
.hlist li dd:last-child:after,
.hlist li dt:last-child:after,
.hlist li li:last-child:after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li:before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
/* Styling for JQuery makeCollapsible, matching that of collapseButton */
.mw-parser-output .mw-collapsible-toggle {
font-weight: normal;
/* @noflip */
text-align: right;
padding-right: 0.2em;
padding-left: 0.2em;
}
.mw-collapsible-leftside-toggle .mw-collapsible-toggle {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
/* Normal font styling for wikitable row headers with scope="row" tag */
.wikitable.plainrowheaders th[scope=row] {
font-weight: normal;
/* @noflip */
text-align: left;
}
/* Lists in wikitable data cells are always left-aligned */
.wikitable td ul,
.wikitable td ol,
.wikitable td dl {
/* @noflip */
text-align: left;
}
/* Fix for hieroglyphs specificity issue in infoboxes ([[phab:T43869]]) */
table.mw-hiero-table td {
vertical-align: middle;
}
/* Change the external link icon to an Adobe icon for all PDF files */
.mw-parser-output a[href$=".pdf"].external,
.mw-parser-output a[href*=".pdf?"].external,
.mw-parser-output a[href*=".pdf#"].external,
.mw-parser-output a[href$=".PDF"].external,
.mw-parser-output a[href*=".PDF?"].external,
.mw-parser-output a[href*=".PDF#"].external {
background: url("//upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif") no-repeat right;
/* @noflip */
padding-right: 18px;
}
/* Messagebox templates */
.messagebox {
border: 1px solid #a2a9b1;
background-color: #f8f9fa;
width: 80%;
margin: 0 auto 1em auto;
padding: .2em;
}
.messagebox.cleanup {
border: 1px solid #9f9fff;
background-color: #efefff;
text-align: center;
}
.messagebox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
width: 100%;
margin: 2px 0;
padding: 2px;
}
.messagebox.small {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
}
.messagebox.small-talk {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
background-color: #f8eaba;
}
/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
th.mbox-text, td.mbox-text { /* The message body cell(s) */
border: none;
/* @noflip */
padding: 0.25em 0.9em; /* 0.9em left/right */
width: 100%; /* Make all mboxes the same width regardless of text length */
}
td.mbox-image { /* The left image cell */
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em; /* 0.9em left, 0px right */
text-align: center;
}
td.mbox-imageright { /* The right image cell */
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0; /* 0px left, 0.9em right */
text-align: center;
}
td.mbox-empty-cell { /* An empty narrow cell */
border: none;
padding: 0;
width: 1px;
}
/* Article message box styles */
table.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
/* Single border between stacked boxes. */
table.ambox + table.ambox,
table.ambox + .mw-empty-elt + table.ambox {
margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text { /* The message body cell(s) */
padding: 0.25em 0.5em; /* 0.5em left/right */
}
.ambox td.mbox-image { /* The left image cell */
/* @noflip */
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright { /* The right image cell */
/* @noflip */
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
}
table.ambox-notice {
/* @noflip */
border-left: 10px solid #36c; /* Blue */
}
table.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
table.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
table.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
table.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
table.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
/* Image message box styles */
table.imbox {
margin: 4px 10%;
border-collapse: collapse;
border: 3px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
.imbox .mbox-text .imbox { /* For imboxes inside imbox-text cells. */
margin: 0 -0.5em; /* 0.9 - 0.5 = 0.4em left/right. */
display: block; /* Fix for webkit to force 100% width. */
}
.mbox-inside .imbox { /* For imboxes inside other templates. */
margin: 4px;
}
table.imbox-notice {
border: 3px solid #36c; /* Blue */
}
table.imbox-speedy {
border: 3px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.imbox-delete {
border: 3px solid #b32424; /* Red */
}
table.imbox-content {
border: 3px solid #f28500; /* Orange */
}
table.imbox-style {
border: 3px solid #fc3; /* Yellow */
}
table.imbox-move {
border: 3px solid #9932cc; /* Purple */
}
table.imbox-protection {
border: 3px solid #a2a9b1; /* Gray-gold */
}
table.imbox-license {
border: 3px solid #88a; /* Dark gray */
background-color: #f7f8ff; /* Light gray */
}
table.imbox-featured {
border: 3px solid #cba135; /* Brown-gold */
}
/* Category message box styles */
table.cmbox {
margin: 3px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1;
background-color: #dfe8ff; /* Default "notice" blue */
box-sizing: border-box;
}
table.cmbox-notice {
background-color: #d8e8ff; /* Blue */
}
table.cmbox-speedy {
margin-top: 4px;
margin-bottom: 4px;
border: 4px solid #b32424; /* Red */
background-color: #ffdbdb; /* Pink */
}
table.cmbox-delete {
background-color: #ffdbdb; /* Pink */
}
table.cmbox-content {
background-color: #ffe7ce; /* Orange */
}
table.cmbox-style {
background-color: #fff9db; /* Yellow */
}
table.cmbox-move {
background-color: #e4d8ff; /* Purple */
}
table.cmbox-protection {
background-color: #efefe1; /* Gray-gold */
}
/* Other pages message box styles */
table.ombox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
table.ombox-notice {
border: 1px solid #a2a9b1; /* Gray */
}
table.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ombox-delete {
border: 2px solid #b32424; /* Red */
}
table.ombox-content {
border: 1px solid #f28500; /* Orange */
}
table.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
table.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
table.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #c0c090; /* Default "notice" gray-brown */
background-color: #f8eaba;
min-width: 80%;
box-sizing: border-box;
}
.tmbox.mbox-small {
min-width: 0; /* reset the min-width of tmbox above */
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" class ensures that */
margin: 2px 0; /* this declaration overrides other styles (including mbox-small above) */
width: 100%; /* For Safari and Opera */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when */
line-height: 1.5em; /* also "nested", so reset styles that are */
font-size: 100%; /* set in "mbox-small" above. */
}
table.tmbox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.tmbox-delete {
border: 2px solid #b32424; /* Red */
}
table.tmbox-content {
border: 2px solid #f28500; /* Orange */
}
table.tmbox-style {
border: 2px solid #fc3; /* Yellow */
}
table.tmbox-move {
border: 2px solid #9932cc; /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
border: 1px solid #c0c090; /* Gray-brown */
}
/* Footer and header message box styles */
table.fmbox {
clear: both;
margin: 0.2em 0;
width: 100%;
border: 1px solid #a2a9b1;
background-color: #f8f9fa; /* Default "system" gray */
box-sizing: border-box;
}
table.fmbox-system {
background-color: #f8f9fa;
}
table.fmbox-warning {
border: 1px solid #bb7070; /* Dark pink */
background-color: #ffdbdb; /* Pink */
}
table.fmbox-editnotice {
background-color: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon,
div.titleblacklist-warning {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* Use default color for partial block fmbox banner per [[Special:PermaLink/1028105567#pblock-style]] */
.mw-contributions-blocked-notice-partial .mw-warning-with-logexcerpt {
border-color: #fc3;
background-color: #fef6e7;
}
/* These mbox-small classes must be placed after all other
ambox/tmbox/ombox etc classes. "html body.mediawiki" is so
they override "table.ambox + table.ambox" above. */
html body.mediawiki .mbox-small { /* For the "small=yes" option. */
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
box-sizing: border-box;
width: 238px;
font-size: 88%;
line-height: 1.25em;
}
html body.mediawiki .mbox-small-left { /* For the "small=left" option. */
/* @noflip */
margin: 4px 1em 4px 0;
box-sizing: border-box;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
/* Style for compact ambox */
/* Hide the images */
.compact-ambox table .mbox-image,
.compact-ambox table .mbox-imageright,
.compact-ambox table .mbox-empty-cell {
display: none;
}
/* Remove borders, backgrounds, padding, etc. */
.compact-ambox table.ambox {
border: none;
border-collapse: collapse;
background-color: transparent;
margin: 0 0 0 1.6em !important;
padding: 0 !important;
width: auto;
display: block;
}
body.mediawiki .compact-ambox table.mbox-small-left {
font-size: 100%;
width: auto;
margin: 0;
}
/* Style the text cell as a list item and remove its padding */
.compact-ambox table .mbox-text {
padding: 0 !important;
margin: 0 !important;
}
.compact-ambox table .mbox-text-span {
display: list-item;
line-height: 1.5em;
list-style-type: square;
list-style-image: url(/w/skins/MonoBook/resources/images/bullet.svg);
}
/* Allow for hiding text in compact form */
.compact-ambox .hide-when-compact {
display: none;
}
/* Remove underlines from certain links */
.nounderlines a,
.IPA a:link,
.IPA a:visited {
text-decoration: none !important;
}
/* Prevent line breaks in silly places where desired (nowrap)
and links when we don't want them to (nowraplinks a) */
.nowrap,
.nowraplinks a {
white-space: nowrap;
}
/* But allow wrapping where desired: */
.wrap,
.wraplinks a {
white-space: normal;
}
/* Increase the height of the image upload box */
#wpUploadDescription {
height: 13em;
}
/* Minimum thumb width */
.thumbinner {
min-width: 100px;
}
/* Prevent floating boxes from overlapping any category listings,
file histories, edit previews, and edit [Show changes] views. */
#mw-subcategories,
#mw-pages,
#mw-category-media,
#filehistory,
#wikiPreview,
#wikiDiff {
clear: both;
}
/* Selectively hide headers in WikiProject banners */
/* TemplateStyles */
.wpb .wpb-header {
display: none;
}
.wpbs-inner .wpb .wpb-header {
display: table-row;
}
.wpbs-inner .wpb-outside {
display: none; /* hide things that should only display outside shells */
}
/* Styling for Abuse Filter tags */
.mw-tag-markers {
font-style: italic;
font-size: 90%;
}
/* Hide stuff meant for accounts with special permissions. Made visible again in
[[MediaWiki:Group-checkuser.css]], [[MediaWiki:Group-sysop.css]], [[MediaWiki:Group-abusefilter.css]],
[[MediaWiki:Group-abusefilter-helper.css]], [[MediaWiki:Group-patroller.css]],
[[MediaWiki:Group-templateeditor.css]], [[MediaWiki:Group-extendedmover.css]],
[[MediaWiki:Group-extendedconfirmed.css]], and [[Mediawiki:Group-autoconfirmed.css]]. */
.checkuser-show,
.sysop-show,
.abusefilter-show,
.abusefilter-helper-show,
.patroller-show,
.templateeditor-show,
.extendedmover-show,
.extendedconfirmed-show,
.autoconfirmed-show,
.user-show {
display: none;
}
/* Hide the redlink generated by {{Editnotice}},
this overrides the ".sysop-show { display: none; }" above that applies
to the same link as well. See [[phab:T45013]]
Hide the images in editnotices to keep them readable in VE view.
Long term, editnotices should become a core feature so that they can be designed responsive. */
.ve-ui-mwNoticesPopupTool-item .editnotice-redlink,
.ve-ui-mwNoticesPopupTool-item .mbox-image,
.ve-ui-mwNoticesPopupTool-item .mbox-imageright {
display: none !important;
}
/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors > li {
list-style: none none;
}
ul.permissions-errors {
margin: 0;
}
/* texhtml class for inline math (based on generic times-serif class) */
span.texhtml {
font-family: "Nimbus Roman No9 L", "Times New Roman", Times, serif;
font-size: 118%;
line-height: 1;
white-space: nowrap;
/* Force tabular and lining display for texhtml */
-moz-font-feature-settings: "lnum", "tnum", "kern" 0;
-webkit-font-feature-settings: "lnum", "tnum", "kern" 0;
font-feature-settings: "lnum", "tnum", "kern" 0;
font-variant-numeric: lining-nums tabular-nums;
font-kerning: none;
}
span.texhtml span.texhtml {
font-size: 100%;
}
span.mwe-math-mathml-inline {
font-size: 118%;
}
/* Make <math display="block"> be left aligned with one space indent for
* compatibility with style conventions
*/
.mwe-math-fallback-image-display,
.mwe-math-mathml-display {
margin-left: 1.6em !important;
margin-top: 0.6em;
margin-bottom: 0.6em;
}
.mwe-math-mathml-display math {
display: inline;
}
/* Work-around for [[phab:T25965]] / [[phab:T100106]] (Kaltura advertisement) */
.k-player .k-attribution {
visibility: hidden;
}
/* Move 'play' button of video player to bottom left corner */
.PopUpMediaTransform a .play-btn-large {
margin: 0;
top: auto;
right: auto;
bottom: 0;
left: 0;
}
@media screen {
/* Gallery styles background changes are restricted to screen view.
In printing we should avoid applying backgrounds. */
/* The backgrounds for galleries. */
#content .gallerybox div.thumb {
/* Light gray padding */
background-color: #f8f9fa;
}
/* Put a chequered background behind images, only visible if they have transparency.
'.filehistory a img' and '#file img:hover' are handled by MediaWiki core (as of 1.19) */
.gallerybox .thumb img {
background: #fff url(//upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png) repeat;
}
/* But not on articles, user pages, portals or with opt-out. */
.ns-0 .gallerybox .thumb img,
.ns-2 .gallerybox .thumb img,
.ns-100 .gallerybox .thumb img,
.nochecker .gallerybox .thumb img {
background-image: none;
}
/* Display "From Wikipedia, the free encyclopedia" in skins that support it,
do not apply to print mode */
#siteSub {
display: block;
}
}
/* Hide FlaggedRevs notice UI when there are no pending changes */
.flaggedrevs_draft_synced,
.flaggedrevs_stable_synced,
/* "Temporary" to remove links in sidebar T255381 */
#t-upload,
/* Hide broken download box on Special:Book pending T285400 */
.mw-special-Book #coll-downloadbox {
display: none;
}
b64d2ecd3f1f4e45d6b23a5c54028445b0d2a112
Template:Infobox
10
116
272
271
2022-01-12T06:14:10Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:Category link with count
10
117
274
273
2022-01-12T06:14:12Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Template:Clear
10
118
276
275
2022-01-12T06:14:13Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Distinguish
10
119
278
277
2022-01-12T06:14:14Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Template:Div col
10
120
280
279
2022-01-12T06:14:15Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly><templatestyles src="Div col/styles.css"/><!--
--><div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}} {{{class|}}}" <!--
-->{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|<!--
-->style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"<!--
-->}}><!--
-->{{#if:{{{content|}}}|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes
-->{{#ifeq:{{{small|}}}|yes|[[Category:Pages using div col with small parameter]]}}<!--
--></includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using div col with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Div col]] with unknown parameter "_VALUE_"; use colwidth= to specify column size |ignoreblank=y | class | colwidth | content | gap | rules | small | style }}<noinclude>
{{Documentation}}
</noinclude>
6e84133dd867d6c701e7b161878cf66665bb7eb7
Template:Div col/styles.css
10
121
282
281
2022-01-12T06:14:17Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
sanitized-css
text/css
/* {{pp|small=yes}} */
.div-col {
margin-top: 0.3em;
column-width: 30em;
}
.div-col-small {
font-size: 90%;
}
.div-col-rules {
column-rule: 1px solid #aaa;
}
/* Reset top margin for lists in div col */
.div-col dl,
.div-col ol,
.div-col ul {
margin-top: 0;
}
/* Avoid elements breaking between columns
See also Template:No col break */
.div-col li,
.div-col dd {
page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */
break-inside: avoid-column;
}
c6c2dc0cb2bab7a5f7b4eb938eebc5c67df087bc
Template:Div col end
10
122
284
283
2022-01-12T06:14:18Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly></div></includeonly><noinclude>
{{Documentation|Template:Div col/doc}}
</noinclude>
78088d41c21d779e3722f220fcc9773dfbbc1e4f
Template:Documentation
10
35
286
86
2022-01-12T06:14:19Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<!-- {{#invoke:Autotranslate|autotranslate}} is used to avoid "Warning: This page calls Template:Autotranslate which causes a template loop (an infinite recursive call). "-->
<onlyinclude>{{#invoke:Autotranslate|autotranslate
| base = Template:Documentation/i18n
|lang = {{{lang|{{int:Lang}} }}}
|1 = {{#if:{{{1|}}}
|{{{1}}}
|{{#ifexist:{{SUBJECTPAGENAME}}/doc
|{{SUBJECTPAGENAME}}/doc
|{{#ifexist:{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{SUBJECTPAGENAME}}/doc
}}
}}
}}
|2 = {{{heading|{{{2|}}} }}}
|content = {{{content|}}}
}}</onlyinclude>
7ad33c9fa0ba8f527d5f6f881ab8ab02837d7e17
Template:Documentation subpage
10
39
288
94
2022-01-12T06:14:19Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{SUBPAGENAME}}|{{#ifeq:{{{1|}}}|override|{{SUBPAGENAME}}|doc}}|</includeonly><!-- show on doc pages only
-->{{#invoke:Autotranslate | autotranslate
|base = Documentation subpage
|lang = {{{lang|}}}
|page = {{#if:{{{page|}}}|{{{page|}}}|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}
}}<!--
--><includeonly>{{{category|[[Category:{{#switch:{{SUBJECTSPACE}}
| Template = Template
| Module = Module
| User = User
| #default = Template
}} documentation|{{PAGENAME}}]]__EXPECTED_UNCONNECTED_PAGE__}}}</includeonly><!--
--><includeonly>}}</includeonly><!-- show on doc pages only
--><noinclude>{{documentation}}</noinclude>
783c674f03e3009e9b9ddc1cfd632a593534f7c6
Template:High-use
10
123
290
289
2022-01-12T06:14:20Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|all-pages={{{all-pages|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
dc5ea36aa88cf409e3280bf65dbfc2566faffe29
Template:Infobox/doc
10
124
292
291
2022-01-12T06:14:25Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old ||{{High-use|3408796|all-pages=yes}}{{Lua|Module:Infobox}}}}</includeonly>
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
{{tlf|Infobox}} is a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|Infobox building}}).
For <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, template code then looks like this, simplified:
<pre>
{{Infobox
| name = {{{name|{{PAGENAME}}}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| label1 = Former names
| data1 = {{{former_names|}}}
| header2 = General information
| label3 = Status
| data3 = {{{status|}}}
... <!-- etc. -->
}}
</pre>
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however, this is rarely what you want because it will send users clicking these links in an infobox to the template code rather than the data in the infobox they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
; autoheaders: If this is set to any non-blank value, headers which are not followed by data fields are suppressed. See the "[[#Hiding headers when all its data fields are empty|hiding headers when all its data fields are empty]]" section for more details.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts it as a caption on top of the table. You can use them both together, or just one or the other, or neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all its data fields are empty ====
You can also make headers automatically hide when their section is empty (has no data-row showing).
Consider this situation:
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</pre>{{clear}}
If you want hide the header when no {{para|data''N''}} values are present, use '''{{para|autoheaders|y}}''':
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</syntaxhighlight>{{clear}}
So, header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next visible content.
Note: if the data has empty css elements, like {{para|data|2=<span style="background:yellow;"></span>}}, this will be treated as non-empty (having data).
If {{para|autoheaders|y}} but there are items that you ''do not'' want to trigger a header, place {{para|headerX|_BLANK_}}. This will serve as an empty header and separate it from the subsequent items.
{{Infobox
| title = Example: blank header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
</syntaxhighlight>{{clear}}
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
{{div col}}
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; subheaderstyle : Applies to all subheader cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
{{div col end}}
=== HTML classes and microformats ===
{{div col}}
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
{{div col end}}
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others being used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<syntaxhighlight lang="Sass" style="overflow:auto" highlight="15">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</syntaxhighlight>{{clear}}
For this example, the {{para|bodystyle}} and {{para|labelstyle}} parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<syntaxhighlight lang="sass" highlight="3,9" style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</syntaxhighlight>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation. The garbage output can be suppressed using {{para|rowstyleN|display: none}}, replacing N with the data/header number.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</syntaxhighlight>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</syntaxhighlight>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| templatestyles =
| child templatestyles =
| grandchild templatestyles =
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.",
"format": "{{_\n| ________________ = _\n}}\n",
"params": {
"title": {
"label": "Title",
"description": "Title displayed above the infobox",
"type": "string",
"suggested": true
}
},
"paramOrder": [
"title"
]
}
</templatedata>
==Tracking categories==
* {{Category link with count|Articles with missing Wikidata information}}
* {{Category link with count|Articles using infobox templates with no data rows}}
* {{Category link with count|Pages using embedded infobox templates with the title parameter}}
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Module:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
<includeonly>{{Sandbox other||
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
[[Category:Templates that add a tracking category]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
4916f93a28dc7393586e49c6c637705d88b5e3e9
Template:Lua
10
125
294
293
2022-01-12T06:14:26Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Main other
10
81
296
178
2022-01-12T06:14:27Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c8e5526da7586aff37928206e183ceef44ed7829
Template:Nobold
10
126
298
297
2022-01-12T06:14:28Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Nobold/styles.css
10
127
300
299
2022-01-12T06:14:30Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
sanitized-css
text/css
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Template:Para
10
128
302
301
2022-01-12T06:14:31Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
Template:Parameter names example
10
129
304
303
2022-01-12T06:14:32Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
Template:Sandbox other
10
130
306
305
2022-01-12T06:14:32Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Sidebar
10
131
308
307
2022-01-12T06:14:33Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#invoke:Sidebar|sidebar}}<noinclude>
{{documentation}}</noinclude>
ab2498000a99daf324f656b0badd187b4a3e2b42
Template:TemplateData header
10
132
310
309
2022-01-12T06:14:34Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Template link
10
133
312
311
2022-01-12T06:14:35Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Template link expanded
10
134
314
313
2022-01-12T06:14:36Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Template link with link off
10
135
316
315
2022-01-12T06:14:37Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Template other
10
136
318
317
2022-01-12T06:14:38Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Template parameter usage
10
137
320
319
2022-01-12T06:14:39Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
b9cdd1b2e409313904f041c38562a3d6221cc017
Template:Tl
10
54
322
124
2022-01-12T06:14:41Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
<noinclude>{{protected template}}
</noinclude>{{T/main|{{{1|}}}
|{{{2|}}}
|{{{3|{{{lang|}}}}}}
|{{{4|}}}
|{{{5|}}}
|incl={{{incl|{{{i|3}}}}}}
|code={{{code|}}}
|link={{{link|}}}
|case={{{case|}}}
|i18n={{{i18n|}}}
|parm={{{parm|}}}
|full={{{full|}}}
|style={{{style|}}}
}}<noinclude>
{{documentation|Template:T/doc}}
</noinclude>
06c675ce6e24c57cb8f52ad7ad989aeda3525f57
Template:Tlf
10
138
324
323
2022-01-12T06:14:42Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Template:Tlx
10
139
326
325
2022-01-12T06:14:42Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Yesno
10
140
328
327
2022-01-12T06:14:43Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Template:Yesno-no
10
141
330
329
2022-01-12T06:14:44Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Help:Infobox/user style
12
142
332
331
2022-01-12T06:14:46Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
</noinclude>
6da0d499b1fda33a6ba13b40e6605692fc3bb489
Module:Arguments
828
83
334
182
2022-01-12T06:14:47Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Check for unknown parameters
828
143
336
335
2022-01-12T06:14:48Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Module:Distinguish
828
144
338
337
2022-01-12T06:14:49Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Module:Documentation
828
145
340
339
2022-01-12T06:14:51Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink, purgeLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
75db229661bf7a537917c514074614e59a70fd0a
Module:Documentation/config
828
146
342
341
2022-01-12T06:14:52Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
a7cdf1cda3185137d4cb51b2839cd5e5c9b91d18
Module:Documentation/styles.css
828
147
344
343
2022-01-12T06:14:53Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Module:Effective protection expiry
828
148
346
345
2022-01-12T06:14:55Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Module:Effective protection level
828
149
348
347
2022-01-12T06:14:56Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Module:File link
828
150
350
349
2022-01-12T06:14:58Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Module:Format link
828
151
352
351
2022-01-12T06:15:00Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) and (not title.exists) then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
b1a3177dc2ec780dc0a9720bfb64058aed46db95
Module:Hatnote
828
152
354
353
2022-01-12T06:15:01Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(inline == 1 and 'hatnote-inline' or 'hatnote')
:addClass('navigation-not-searchable')
:addClass(extraclasses)
:addClass(options.selfref and 'selfref')
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
44d8f670e8ea9780e48425da6da49c8a5ba1fc20
Module:Hatnote/styles.css
828
153
356
355
2022-01-12T06:15:03Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
sanitized-css
text/css
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Module:Hatnote list
828
154
358
357
2022-01-12T06:15:05Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
Module:High-use
828
155
360
359
2022-01-12T06:15:06Z
TheSink
2
1 revision imported: Import Infobox from Wikipedia
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and (",''' and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
f7d07eb75abeaf93ce3dcb9515d8ac175bbfeb48
Module:Infobox/styles.css
828
157
362
2022-01-12T06:16:49Z
TheSink
2
Created page with "/* {{pp|small=y}} */ /* * This TemplateStyles sheet deliberately does NOT include the full set of * infobox styles. We are still working to migrate all of the manual * infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]] * DO NOT ADD THEM HERE */ /* * not strictly certain these styles are necessary since the modules now * exclusively output infobox-subbox or infobox, not both * just replicating the module faithfully */ .infobox-subbox { padding: 0; borde..."
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
059faa215ace386eb0e16526c7514be34ded4bb7
Module:Transclusion count
828
158
363
2022-01-12T06:18:20Z
TheSink
2
Created page with "local p = {} function p.fetch(frame) local template = nil local return_value = nil -- Use demo parameter if it exists, otherswise use current template name local namespace = mw.title.getCurrentTitle().namespace if frame.args["demo"] and frame.args["demo"] ~= "" then template = frame.args["demo"] elseif namespace == 10 then -- Template namespace template = mw.title.getCurrentTitle().text elseif namespace == 828 then -- Module namespace template = (mw.site.n..."
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = frame.args["demo"]
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
9b2940dfd623cf550f748fd5bfc25b7f69cd14cd
Template:Documentation/styles.css
10
38
364
92
2022-01-12T06:20:03Z
TheSink
2
TheSink changed the content model of the page [[Template:Documentation/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
.template-documentation {
margin-top: 1em;
clear: both;
border: 2px dotted #666;
padding: 0.6em;
background-color: #ecfcf4;
}
.template-documentation:after {
content: "";
display: block;
clear: both;
}
.template-documentation-heading {
padding-bottom: 3px;
border-bottom: 1px solid #a2a9b1;
margin-bottom: 1ex;
}
.template-documentation-title {
font-size: 150%;
}
.template-documentation-transcludedfrom {
font-size: smaller;
font-style: italic;
}
937a4c089853e87d6903631231b1de77089e938a
Module:Yesno
828
159
365
2022-01-12T06:24:50Z
TheSink
2
Created page with "-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val =..."
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Template link general
828
160
366
2022-01-12T06:26:48Z
TheSink
2
Created page with "-- This implements Template:Tlg local getArgs = require('Module:Arguments').getArgs local p = {} -- Is a string non-empty? local function _ne(s) return s ~= nil and s ~= "" end local nw = mw.text.nowiki local function addTemplate(s) local i, _ = s:find(':', 1, true) if i == nil then return 'Template:' .. s end local ns = s:sub(1, i - 1) if ns == '' or mw.site.namespaces[ns] then return s else return 'Template:' .. s end end local function trimTemplate(..."
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = ""
local i = 2
while args[i] do
local val = args[i]
textPartBuffer = textPartBuffer .. '|'
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
textPart = textPart .. textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
return ret
end
return p
737651670b1eb932db151ad2b9ff37e683e44c74
Module:Navbar
828
161
367
2022-01-12T06:27:34Z
TheSink
2
Created page with "local p = {} local cfg = mw.loadData('Module:Navbar/configuration') local function get_title_arg(is_collapsible, template) local title_arg = 1 if is_collapsible then title_arg = 2 end if template then title_arg = 'template' end return title_arg end local function choose_links(template, args) -- The show table indicates the default displayed items. -- view, talk, edit, hist, move, watch -- TODO: Move to configuration. local show = {true, true, true, false, false..."
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
Module:Navbar/configuration
828
162
368
2022-01-12T06:28:00Z
TheSink
2
Created page with "return { ['templatestyles'] = 'Module:Navbar/styles.css', ['box_text'] = 'This box: ', -- default text box when not plain or mini ['title_namespace'] = 'Template', -- namespace to default to for title ['invalid_title'] = 'Invalid title ', ['classes'] = { -- set a line to nil if you don't want it ['navbar'] = 'navbar', ['plainlinks'] = 'plainlinks', -- plainlinks ['horizontal_list'] = 'hlist', -- horizontal list class ['mini'] = 'navbar-mini', -- class ind..."
Scribunto
text/plain
return {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
bbf3d86b48a5b40835e8e232ae9821e6bca390ec
Module:Navbar/styles.css
828
163
369
2022-01-12T06:28:43Z
TheSink
2
Created page with "/* {{pp|small=yes}} */ .navbar { display: inline; font-size: 88%; font-weight: normal; } .navbar-collapse { float: left; text-align: left; } .navbar-boxtext { word-spacing: 0; } .navbar ul { display: inline-block; white-space: nowrap; line-height: inherit; } .navbar-brackets::before { margin-right: -0.125em; content: '[ '; } .navbar-brackets::after { margin-left: -0.125em; content: ' ]'; } .navbar li { word-spacing: -0.125em; } .navbar a > span, .nav..."
sanitized-css
text/css
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar a > span,
.navbar a > abbr {
text-decoration: inherit;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
9d4056f949b4f0b159e3d40dfb1a5f01e72f9571
Module:String
828
164
370
2022-01-12T06:30:11Z
TheSink
2
Created page with "--[[ This module is intended to provide access to basic string functions. Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace. Global options ignore_errors: If set to 'true' or 1, any error c..."
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
6df794dd52434e0f6a372c9918f5a9dedd15f579
Module:Message box
828
165
371
2022-01-12T06:30:47Z
TheSink
2
Created page with "-- This is a meta-module for producing message box templates, including -- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}. -- Load necessary modules. require('Module:No globals') local getArgs local yesno = require('Module:Yesno') -- Get a language object for formatDate and ucfirst. local lang = mw.language.getContentLanguage() -- Define constants local CONFIG_MODULE = 'Module:Message box/configuration' local DEMOSPACES = {talk = 'tmbox'..."
Scribunto
text/plain
-- This is a meta-module for producing message box templates, including
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
-- Load necessary modules.
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
-- Get a language object for formatDate and ucfirst.
local lang = mw.language.getContentLanguage()
-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'>''(<span class='date'>%s</span>)''</span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:0;width:1px'
end
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
:cssText(self.imageEmptyCellStyle or nil)
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):css('width', '52px')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:css('text-align', 'center')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
b1fd4c365d29a34bbcf3aef2adec6701ed0efe45
Module:Lua banner
828
166
372
2022-01-12T06:31:51Z
TheSink
2
Created page with "-- This module implements the {{lua}} template. local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args)..."
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation'] = 'Templates based on the Citation/CS1 Lua module'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
6e3bedcc849ff22d4f702708965c39b97d7e8585
Module:Parameter names example
828
167
373
2022-01-12T06:32:15Z
TheSink
2
Created page with "-- This module implements {{parameter names example}}. local p = {} local function makeParam(s) local lb = '{' local rb = '}' return lb:rep(3) .. s .. rb:rep(3) end local function italicize(s) return "''" .. s .. "''" end local function plain(s) return s end function p._main(args, frame) -- Find how we want to format the arguments to the template. local formatFunc if args._display == 'italics' or args._display == 'italic' then formatFunc = italic..."
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
targs['nocat'] = 'yes';
targs['categories'] = 'no';
targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
576eb8298850f4e4e62105ac740df295b7b7eb9e
Module:List
828
168
374
2022-01-12T06:33:13Z
TheSink
2
Created page with "-- This module outputs different kinds of lists. At the moment, bulleted, -- unbulleted, horizontal, ordered, and horizontal ordered lists are supported. local libUtil = require('libraryUtil') local checkType = libUtil.checkType local mTableTools = require('Module:TableTools') local p = {} local listTypes = { ['bulleted'] = true, ['unbulleted'] = true, ['horizontal'] = true, ['ordered'] = true, ['horizontal_ordered'] = true } function p.makeListData(listType, ar..."
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist hlist-separated')
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
0d6c114450d0f5b3c1d2171ebeb41ae74f203f88
Module:Message box/configuration
828
169
375
2022-01-12T06:34:05Z
TheSink
2
Created page with "-------------------------------------------------------------------------------- -- Message box configuration -- -- -- -- This module contains configuration data for [[Module:Message box]]. -- -------------------------------------------------------------------------------- return { ambox = { types = { speedy = { class = 'ambox-spee..."
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
imageEmptyCellStyle = true,
templateCategory = 'Talk message boxes'
}
}
ef8171b8278c52d9c20a4149614d97cd948670c2
Template:Tracked/styles.css
10
58
376
132
2022-01-12T06:39:12Z
TheSink
2
TheSink changed the content model of the page [[Template:Tracked/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/**
* Styles for [[Template:Tracked]].
*/
.tracked {
float: right;
clear: right;
border: 1px solid #999;
border-radius: 0.5em;
background-color: #eee;
background-image: linear-gradient(to bottom, #ddd,#eee);
font-size: 85%;
text-align: center;
padding: 0.5em;
margin-left: 1em;
margin-bottom: 1em;
width: 12em;
color: black;
}
.tracked p {
margin: 0;
}
.tracked-url {
font-weight: bold;
}
/* status line */
.tracked .status,
.tracked-status {
font-weight: bold;
text-transform: uppercase;
}
.tracked .status.resolved,
.tracked-resolved {
color: green;
}
.tracked .status.critical,
.tracked-critical {
color: red;
font-size: 1.5em;
}
380e3497ad1559974c1965d32a486b9f188bf47c
Template:TemplateBox/styles.css
10
49
377
114
2022-01-12T06:39:13Z
TheSink
2
TheSink changed the content model of the page [[Template:TemplateBox/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
.templatebox-desc {
font-size: 1.2em;
font-weight: bolder;
padding: 0.2em;
text-shadow: 1px 1px 1px rgb(255, 255, 255);
}
.templatebox-usagesample {
background: white;
background: rgba(255, 255, 255, 0.9);
font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono',
'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace;
}
.templatebox-languagedependant {
background: rgba(255, 255, 255, 0.5);
padding: 0.2em;
}
.templatebox-example {
border: 1px solid black;
background-color: white;
width: 90%;
padding: 1.5em;
}
.templatebox-example:after {
display: block;
content: "";
clear: both;
}
hr.templatebox-examples-separator {
margin: 1em 0;
}
8ed2a78f01e66c149aa24c906458f66c0da13a5c
Module:Sidebar
828
170
378
2022-01-12T06:52:59Z
TheSink
2
Created page with "-- -- This module implements {{Sidebar}} -- require('Module:No globals') local cfg = mw.loadData('Module:Sidebar/configuration') local p = {} local getArgs = require('Module:Arguments').getArgs --[[ Categorizes calling templates and modules with a 'style' parameter of any sort for tracking to convert to TemplateStyles. TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module. TODO would probably want to remove /log and /archive as CS1 do..."
Scribunto
text/plain
--
-- This module implements {{Sidebar}}
--
require('Module:No globals')
local cfg = mw.loadData('Module:Sidebar/configuration')
local p = {}
local getArgs = require('Module:Arguments').getArgs
--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
if title.text:match(pattern) then return '' end
end
for key, _ in pairs(args) do
if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
return cfg.i18n.category.conversion
end
end
end
--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function hasSubgroup(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
else
return false
end
end
--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
if not args then
args = getArgs(frame)
end
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(cfg.i18n.class.outer_title)
:addClass(args.outertitleclass)
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.top_image)
:addClass(args.topimageclass)
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.top_caption)
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
or cfg.i18n.class.pretitle)
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass(cfg.i18n.class.subgroup)
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
or cfg.i18n.class.title)
:addClass(args.titleclass)
:cssText(args.basestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.image)
:addClass(args.imageclass)
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.caption)
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.above)
:addClass(args.aboveclass)
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
-- and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(cfg.i18n.class.heading)
:addClass(args.headingclass)
:addClass(args['heading' .. num .. 'class'])
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
root
:tag('tr')
:tag('td')
:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup
or cfg.i18n.class.content)
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
-- Without a linebreak after the </td>, a nested list like
-- "* {{hlist| ...}}" doesn't parse correctly.
:newline()
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.below)
:addClass(args.belowclass)
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child then
if args.navbar ~= cfg.i18n.navbar_none and args.navbar ~= cfg.i18n.navbar_off and
(args.name or frame:getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
cfg.i18n.title_not_to_add_navbar) then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.navbar)
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle
})
end
end
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
}
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles,
tostring(root),
(child and cfg.i18n.category.child or ''),
categorizeTemplatesWithInlineStyles(args)
})
end
local function list_title(args, is_centered_list_titles, num)
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
or cfg.i18n.default_list_title)
local title
if is_centered_list_titles then
-- collapsible can be finicky, so provide some CSS/HTML to support
title = mw.html.create('div')
:addClass(cfg.i18n.class.list_title_centered)
:wikitext(title_text)
else
title = mw.html.create()
:wikitext(title_text)
end
local title_container = mw.html.create('div')
:addClass(cfg.i18n.class.list_title)
-- don't /need/ a listnumtitleclass because you can do
-- .templateclass .listnumclass .sidebar-list-title
:addClass(args.listtitleclass)
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
:done()
return title_container
end
--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
local args = getArgs(frame)
if not args.name and
frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
end
local contentArgs = {}
local is_centered_list_titles
if args['centered list titles'] and args['centered list titles'] ~= '' then
is_centered_list_titles = true
else
is_centered_list_titles = false
end
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and
(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass(cfg.i18n.class.list)
:addClass('mw-collapsible')
:addClass((not expand) and 'mw-collapsed' or nil)
:addClass(args['list' .. num .. 'class'])
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:node(list_title(args, is_centered_list_titles, num))
:tag('div')
:addClass(cfg.i18n.class.list_content)
:addClass('mw-collapsible-content')
-- don't /need/ a listnumstyleclass because you can do
-- .templatename .listnumclass .sidebar-list
:addClass(args.listclass)
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args, cfg.i18n.class.collapse)
end
return p
7591145c23ee59ac9381516327bc376f741bbb5f
Module:Sidebar/configuration
828
171
379
2022-01-12T06:53:33Z
TheSink
2
Created page with "return { i18n = { child_yes = 'yes', float_none = 'none', float_left = 'left', wrap_true = 'true', navbar_none = 'none', navbar_off = 'off', default_list_title = 'List', title_not_to_add_navbar = 'Template:Sidebar', collapse_title_not_to_add_navbar = 'Template:Sidebar with collapsible lists', templatestyles = 'Module:Sidebar/styles.css', category = { child = '[[Category:Pages using sidebar with the child parameter]]', conversion = '[[Category..."
Scribunto
text/plain
return {
i18n = {
child_yes = 'yes',
float_none = 'none',
float_left = 'left',
wrap_true = 'true',
navbar_none = 'none',
navbar_off = 'off',
default_list_title = 'List',
title_not_to_add_navbar = 'Template:Sidebar',
collapse_title_not_to_add_navbar = 'Template:Sidebar with collapsible lists',
templatestyles = 'Module:Sidebar/styles.css',
category = {
child = '[[Category:Pages using sidebar with the child parameter]]',
conversion = '[[Category:Sidebars with styles needing conversion]]'
},
pattern = {
collapse_sandbox = '/sandbox$',
sandbox = '/sandbox$',
subgroup = 'sidebar%-subgroup',
style_conversion = 'style$',
uncategorized_conversion_titles = {
'/[Ss]andbox',
'/[Tt]estcases',
'/[Dd]oc$'
}
},
class = {
sidebar = 'sidebar',
subgroup = 'sidebar-subgroup',
collapse = 'sidebar-collapse',
float_none = 'sidebar-none',
float_left = 'sidebar-left',
wraplinks = 'nowraplinks',
outer_title = 'sidebar-outer-title',
top_image = 'sidebar-top-image',
top_caption = 'sidebar-top-caption',
pretitle = 'sidebar-pretitle',
pretitle_with_top_image = 'sidebar-pretitle-with-top-image',
title = 'sidebar-title',
title_with_pretitle = 'sidebar-title-with-pretitle',
image = 'sidebar-image',
caption = 'sidebar-caption',
above = 'sidebar-above',
heading = 'sidebar-heading',
content = 'sidebar-content',
content_with_subgroup = 'sidebar-content-with-subgroup',
below = 'sidebar-below',
navbar = 'sidebar-navbar',
list = 'sidebar-list',
list_title = 'sidebar-list-title',
list_title_centered = 'sidebar-list-title-c',
list_content = 'sidebar-list-content'
}
}
}
069f50eb6a0f1833c7d37d07016b05305b5ed00c
Module:Sidebar/styles.css
828
172
380
2022-01-12T06:54:52Z
TheSink
2
Created page with "/* {{pp-template}} */ /* TODO: Invert width design to be "mobile first" */ .sidebar { /* TODO: Ask if we should have max-width 22em instead */ width: 22em; /* @noflip */ float: right; /* @noflip */ clear: right; /* @noflip */ margin: 0.5em 0 1em 1em; background: #f8f9fa; border: 1px solid #aaa; padding: 0.2em; text-align: center; line-height: 1.4em; font-size: 88%; border-collapse: collapse; /* Timeless has display: none on .nomobile at mobile resolutions..."
sanitized-css
text/css
/* {{pp-template}} */
/* TODO: Invert width design to be "mobile first" */
.sidebar {
/* TODO: Ask if we should have max-width 22em instead */
width: 22em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
/* @noflip */
margin: 0.5em 0 1em 1em;
background: #f8f9fa;
border: 1px solid #aaa;
padding: 0.2em;
text-align: center;
line-height: 1.4em;
font-size: 88%;
border-collapse: collapse;
/* Timeless has display: none on .nomobile at mobile resolutions, so we
* unhide it with display: table and let precedence and proximity win.
*/
display: table;
}
/* Unfortunately, so does Minerva desktop, except Minerva drops an
* !important on the declaration. So we have to be mean for Minerva users.
* Mobile removes the element entirely with `wgMFRemovableClasses` in
* https://github.com/wikimedia/operations-mediawiki-config/blob/master/
wmf-config/InitialiseSettings.php#L16992
* which is why displaying it categorically with display: table works.
* We don't really want to expose the generic user in the wild on mobile to have
* to deal with sidebars. (Maybe the ones with collapsible lists, so that
* might be an improvement. That is blocked on [[:phab:T111565]].)
*/
body.skin-minerva .sidebar {
display: table !important;
/* also, minerva is way too aggressive about other stylings on tables.
* TODO remove when this template gets moved to a div. plans on talk page.
* We always float right on Minerva because that's a lot of extra CSS
* otherwise. */
float: right !important;
margin: 0.5em 0 1em 1em !important;
}
.sidebar-subgroup {
width: 100%;
margin: 0;
border-spacing: 0;
}
.sidebar-left {
/* @noflip */
float: left;
/* @noflip */
clear: left;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-none {
float: none;
clear: both;
/* @noflip */
margin: 0.5em 1em 1em 0;
}
.sidebar-outer-title {
padding: 0 0.4em 0.2em;
font-size: 125%;
line-height: 1.2em;
font-weight: bold;
}
.sidebar-top-image {
padding: 0.4em;
}
.sidebar-top-caption,
.sidebar-pretitle-with-top-image,
.sidebar-caption {
padding: 0.2em 0.4em 0;
line-height: 1.2em;
}
.sidebar-pretitle {
padding: 0.4em 0.4em 0;
line-height: 1.2em;
}
.sidebar-title,
.sidebar-title-with-pretitle {
padding: 0.2em 0.8em;
font-size: 145%;
line-height: 1.2em;
}
.sidebar-title-with-pretitle {
padding: 0.1em 0.4em;
}
.sidebar-image {
padding: 0.2em 0.4em 0.4em;
}
.sidebar-heading {
padding: 0.1em 0.4em;
}
.sidebar-content {
padding: 0 0.5em 0.4em;
}
.sidebar-content-with-subgroup {
padding: 0.1em 0.4em 0.2em;
}
.sidebar-above,
.sidebar-below {
padding: 0.3em 0.8em;
font-weight: bold;
}
.sidebar-collapse .sidebar-above,
.sidebar-collapse .sidebar-below {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
}
.sidebar-navbar {
text-align: right;
font-size: 115%;
padding: 0 0.4em 0.4em;
}
.sidebar-list-title {
padding: 0 0.4em;
text-align: left;
font-weight: bold;
line-height: 1.6em;
font-size: 105%;
}
/* centered text with mw-collapsible headers is finicky */
.sidebar-list-title-c {
padding: 0 0.4em;
text-align: center;
margin: 0 3.3em;
}
@media (max-width: 720px) {
/* users have wide latitude to set arbitrary width and margin :(
"Super-specific" selector to prevent overriding this appearance by
lower level sidebars too */
body.mediawiki .sidebar {
width: 100% !important;
clear: both;
float: none !important; /* Remove when we div based; Minerva is dumb */
margin-left: 0 !important;
margin-right: 0 !important;
}
/* TODO: We might consider making all links wrap at small resolutions and then
* only introduce nowrap at higher resolutions. Do when we invert the media
* query.
*/
}
7d621b35a37807a103b59075851fe36201204ceb
Module:Infobox/doc
828
173
381
2022-01-12T06:55:55Z
TheSink
2
Created page with "{{High-use|3308957|all-pages = yes}} {{module rating|protected}} {{Lua|Module:Navbar}} {{Uses TemplateStyles|Module:Infobox/styles.css}} '''Module:Infobox''' is a [[WP:Module|module]] that implements the {{tl|Infobox}} template. Please see the template page for usage instructions. == Tracking categories == * {{clc|Pages using infobox templates with ignored data cells}} * {{clc|Articles using infobox templates with no data rows}} * {{clc|Pages using embedded infobox tem..."
wikitext
text/x-wiki
{{High-use|3308957|all-pages = yes}}
{{module rating|protected}}
{{Lua|Module:Navbar}}
{{Uses TemplateStyles|Module:Infobox/styles.css}}
'''Module:Infobox''' is a [[WP:Module|module]] that implements the {{tl|Infobox}} template. Please see the template page for usage instructions.
== Tracking categories ==
* {{clc|Pages using infobox templates with ignored data cells}}
* {{clc|Articles using infobox templates with no data rows}}
* {{clc|Pages using embedded infobox templates with the title parameter}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
[[Category:Modules that add a tracking category]]
[[Category:Wikipedia infoboxes]]
[[Category:Infobox modules]]
[[Category:Modules that check for strip markers]]
}}</includeonly>
0d128955dc3c62d525788d208bd2cc5e9f438393
User:ChromeEight
2
99
382
267
2022-01-12T14:04:16Z
ChromeEight
7
proper talk page
wikitext
text/x-wiki
Hi, I'm ChromeEight, formerly known as RobloxGuy6403<ref name="name">pls dont judge me i was 8 years old when i came up with it</ref>. I originally created the CVRF project as the JKR Research Facility back in 2015, so this project so far has really been a real work in progress over the years.
Feel free to leave me any (constructive) messages on my talk page!
== Notes==
<References/>
827952b8d57b7f538057e36615d778dd7f7ca131
385
382
2022-01-12T17:38:22Z
TheSink
2
Reverted edits by [[Special:Contributions/ChromeEight|ChromeEight]] ([[User talk:ChromeEight|talk]]) to last revision by [[User:Lule34567|Lule34567]]
wikitext
text/x-wiki
hi im chromeEight, seven ate nine. ten doesn't exist. six is my step-sister. and eleven divorced five. who is eleven?
stink
9198d1f9a8e9a37daa8929381c496e14e4c0c9cf
386
385
2022-01-12T17:39:56Z
TheSink
2
Reverted edits by [[Special:Contributions/TheSink|TheSink]] ([[User talk:TheSink|talk]]) to last revision by [[User:ChromeEight|ChromeEight]]
wikitext
text/x-wiki
Hi, I'm ChromeEight, formerly known as RobloxGuy6403<ref name="name">pls dont judge me i was 8 years old when i came up with it</ref>. I originally created the CVRF project as the JKR Research Facility back in 2015, so this project so far has really been a real work in progress over the years.
Feel free to leave me any (constructive) messages on my talk page!
== Notes==
<References/>
827952b8d57b7f538057e36615d778dd7f7ca131
User talk:ChromeEight
3
100
383
227
2022-01-12T17:23:29Z
Lule34567
6
added comment
wikitext
text/x-wiki
== trolling chrome's profile ==
first come first serve. this is my land. I have 90,000 hours logged in the CVRF Wiki, I know as many formatting tricks as god himself, I have 50,000 pages created and 400,000 edits, I will write an entire wiki page for your house being bombed by pakistan and make sure your family knows your dead for. I will continuously screw around in your profile and make sure you're always next.
p.s. this is a joke please don't ban me :(
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 20:56, 7 January 2022 (UTC)
: it better be a joke [[User:AyScorch|Scorch]] ([[User talk:AyScorch|talk]]) 21:02, 7 January 2022 (UTC)
:: I can change your bio in a minutes pass. --[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 04:09, 8 January 2022 (UT
== respect for the old bio ==
press F to pay respects for chrome's old profile bio.
"hi im chromeEight, seven ate nine. ten doesn't exist. six is my step-sister. and eleven divorced five. who is eleven?"
cb87f75665469046683a779acd5440dc1a6f24b4
384
383
2022-01-12T17:30:42Z
TheSink
2
Reverted edits by [[Special:Contributions/Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) to last revision by [[User:AyScorch|AyScorch]]
wikitext
text/x-wiki
== trolling chrome's profile ==
first come first serve. this is my land. I have 90,000 hours logged in the CVRF Wiki, I know as many formatting tricks as god himself, I have 50,000 pages created and 400,000 edits, I will write an entire wiki page for your house being bombed by pakistan and make sure your family knows your dead for. I will continuously screw around in your profile and make sure you're always next.
p.s. this is a joke please don't ban me :(
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 20:56, 7 January 2022 (UTC)
: it better be a joke [[User:AyScorch|Scorch]] ([[User talk:AyScorch|talk]]) 21:02, 7 January 2022 (UTC)
c6cbf933655a13cfd86baa242da205f8d5abe0e7
387
384
2022-01-12T17:42:20Z
TheSink
2
Blanked the page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Template:Tick
10
174
388
2022-01-13T11:14:48Z
ChromeEight
7
Created page
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|green |grn |gn =File:Yes check.svg
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Yes check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
55c6f1dfd676a1a9bd8abfe426be478f58ca8b0b
391
388
2022-01-13T11:32:42Z
ChromeEight
7
Updated default
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|green |grn |gn =File:Yes check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Light green check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
752430545b2c16bcabe1ffe904901605faeef722
Template:Tick/doc
10
175
389
2022-01-13T11:15:04Z
ChromeEight
7
Created page
wikitext
text/x-wiki
{{Documentation subpage}}
{{used in system|in [[MediaWiki:movepage-moved]]}}
This template inserts a green tick (check mark) inline in the text. It is often used as the opposite of {{tlx|Cross}}.
==Usage==
This template inserts an inline green tick or check (''✓'') image, indicating agreement (or other affirmatives: acceptance, completion, etc.). {{strong|It is not for use in articles.}}
The tick image defaults to 20px in size. To change the size, call with a pixel value as an argument, such as:
: {{tnull|tick|'''30'''}}
The {{para|color}} or {{para|colour}} parameter can be used to change the color of the ''✓'':
{| class="wikitable"
|-
! colspan=4 | color codes !! output !! notes
|-
| green || || grn || gn || [[File:Yes check.svg|20px]] || the default
|-
| lightgreen || lgreen || lgrn || lgn || [[File:Light green check.svg|20px]] ||
|-
| red || || rd || r || [[File:Red check.svg|20px]] ||
|-
| darkred || dkred || drd || dr || [[File:Check-188-25-49-red.svg|20px]] ||
|-
| pink || || pnk || pk || [[File:Pink check.svg|20px]] ||
|-
| orange || || or || o || [[File:Check.svg|20px]] ||
|-
| yellow || || yel || y || [[File:Yellow check.svg|20px]] ||
|-
| blue || || blu || u || [[File:Check-blue.svg|20px]] ||
|-
| lightblue || lblue || lblu || lb || [[File:Cornflower blue check.svg|20px]] ||
|-
| cyan || || cy || c || [[File:B-check.svg|20px]] ||
|-
| purple || || pur || pu || [[File:Purple check.svg|20px]] ||
|-
| brown || || brn || bn || [[File:Brown check.svg|20px]] ||
|-
| black || || blk || k || [[File:Black check.svg|20px]] ||
|-
| grey || gray || gry || gy || [[File:SemiTransBlack v.svg|20px]] || is actually semi-transparent
|}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "A template that inserts a green (by default) tick (check mark) inline in the text",
"params": {
"1": {
"label": "Size",
"description": "Sets the size of the tick mark",
"type": "number",
"default": "20",
"required": false
},
"color": {
"aliases": [ "colour" ],
"label": "Color",
"description": "Sets the color of the tick mark",
"type": "string",
"default": "green",
"required": false
}
},
"format": "inline"
}
</templatedata>
== See also ==
{{Check mark templates}}
{{Done/See also}}
<includeonly>{{Sandbox other||
[[Category:Checkmark insertion templates]]
}}</includeonly>
7eb75ba7d37368c18a00800f8e8b33102f7db3d1
390
389
2022-01-13T11:30:21Z
ChromeEight
7
Added WP reference and removed errors
wikitext
text/x-wiki
This template inserts a green tick (check mark) inline in the text. It is often used as the opposite of {{tlx|Cross}}.
==Usage==
This template inserts an inline green tick or check (''✓'') image, indicating agreement (or other affirmatives: acceptance, completion, etc.).
The tick image defaults to 20px in size. To change the size, call with a pixel value as an argument.
The {{para|color}} or {{para|colour}} parameter can be used to change the color of the ''✓'':
{| class="wikitable"
|-
! colspan=4 | color codes !! output !! notes
|-
| green || || grn || gn || [[File:Yes check.svg|20px]] ||
|-
| lightgreen || lgreen || lgrn || lgn || [[File:Light green check.svg|20px]] || the default
|-
| red || || rd || r || [[File:Red check.svg|20px]] ||
|-
| darkred || dkred || drd || dr || [[File:Check-188-25-49-red.svg|20px]] ||
|-
| pink || || pnk || pk || [[File:Pink check.svg|20px]] ||
|-
| orange || || or || o || [[File:Check.svg|20px]] ||
|-
| yellow || || yel || y || [[File:Yellow check.svg|20px]] ||
|-
| blue || || blu || u || [[File:Check-blue.svg|20px]] ||
|-
| lightblue || lblue || lblu || lb || [[File:Cornflower blue check.svg|20px]] ||
|-
| cyan || || cy || c || [[File:B-check.svg|20px]] ||
|-
| purple || || pur || pu || [[File:Purple check.svg|20px]] ||
|-
| brown || || brn || bn || [[File:Brown check.svg|20px]] ||
|-
| black || || blk || k || [[File:Black check.svg|20px]] ||
|-
| grey || gray || gry || gy || [[File:SemiTransBlack v.svg|20px]] || is actually semi-transparent
|}
== See also ==
* [https://en.wikipedia.org/wiki/Template:Tick Template:Tick] on [https://en.wikipedia.org/ Wikipedia.org]
* [https://en.wikipedia.org/wiki/Template:Tick/doc Template:Tick/doc] on [https://en.wikipedia.org/ Wikipedia.org]
81c9ce661d0e73e1078c14881a1e7d06355aa687
Template:Cross
10
176
392
2022-01-13T11:47:41Z
ChromeEight
7
Created page
wikitext
text/x-wiki
[[{{ {{{|safesubst:}}}#switch:{{ {{{|safesubst:}}}lc:{{{color|{{{colour|}}}}}} }}
|red |rd |r =File:X mark.svg
|darkred |dkred |drd |dr =File:Dark Red x.svg
|orange |or |o =File:Orange x.svg
|yellow |yel |y =File:Dark yellow x.svg
|black |blk |k =File:Black x.svg
|grey |gray |gry |gy =File:SemiTransBlack x.svg
<!--default--> |File:X mark.svg
}}|{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt=☒]]<span style="display:none">N</span><!--template:cross--><noinclude>
{{documentation}}
</noinclude>
== See also ==
* [https://en.wikipedia.org/wiki/Template:Xmark Template:Xmark] on [https://en.wikipedia.org/ Wikipedia.org]
* [https://en.wikipedia.org/wiki/Template:Xmark/doc Template:Xmark/doc] on [https://en.wikipedia.org/ Wikipedia.org]
0fd204d3fc4c06020622f5cc984bfd15734b2972
394
392
2022-01-13T11:49:14Z
ChromeEight
7
Removed 'see also' section from template
wikitext
text/x-wiki
[[{{ {{{|safesubst:}}}#switch:{{ {{{|safesubst:}}}lc:{{{color|{{{colour|}}}}}} }}
|red |rd |r =File:X mark.svg
|darkred |dkred |drd |dr =File:Dark Red x.svg
|orange |or |o =File:Orange x.svg
|yellow |yel |y =File:Dark yellow x.svg
|black |blk |k =File:Black x.svg
|grey |gray |gry |gy =File:SemiTransBlack x.svg
<!--default--> |File:X mark.svg
}}|{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|20}}px|link=|alt=☒]]<span style="display:none">N</span><!--template:cross--><noinclude>
{{documentation}}
</noinclude>
da90b56e4ffd6a08090095e4cbdb14521c3813fe
Template:Cross/doc
10
177
393
2022-01-13T11:47:57Z
ChromeEight
7
Created page
wikitext
text/x-wiki
This template inserts a red ''X'' inline in the text. It is often used as the opposite of {{tlx|Tick}}.
==Usage==
This template inserts an inline red diagonal cross (''X'') image, indicating negation (or some other negatory message: rejection, failure, etc.).
The cross image defaults to 20px in size. To change the size, call with a pixel value as an argument.
The {{para|color}} or {{para|colour}} parameter can be used to change the color of the ''X'':
{| class="wikitable"
|-
! colspan=4 | color codes !! output !! notes
|-
|red || || rd || r || [[File:X mark.svg|20px]] || the default
|-
|darkred || dkred || drd || dr || [[File:Dark Red x.svg|20px]] ||
|-
|orange || || or || o || [[File:Orange x.svg|20px]] ||
|-
|yellow || || yel || y || [[File:Dark yellow x.svg|20px]] ||
|-
|black || || blk || k || [[File:Black x.svg|20px]] ||
|-
|grey || gray || gry || gy || [[File:SemiTransBlack x.svg|20px]] || is actually semi-transparent
|}
== See also ==
* [https://en.wikipedia.org/wiki/Template:Xmark Template:Xmark] on [https://en.wikipedia.org/ Wikipedia.org]
* [https://en.wikipedia.org/wiki/Template:Xmark/doc Template:Xmark/doc] on [https://en.wikipedia.org/ Wikipedia.org]
276f7fb39be57c16f75cdf5524c4c3072b90b841
Living quarters
0
178
395
2022-01-13T11:58:17Z
ChromeEight
7
Created page
wikitext
text/x-wiki
The '''Living quarters''' are upcoming several locations around the facility where players will be able to claim as their own personal quarters.
==Features==
=== Unowned and owned rooms ===
Any unowned room can be rented by the player for the duration of their stay in the server. A room can be set to unowned anytime after owning one.
=== Room customizations ===
''To be added''
===Access levels===
Players will be able to control who is able to go in and out of their quarters through different access levels, outlined below:
{| class="wikitable"
|+Room Access Levels
!Roles
! style=max-width:8em rowspan="2" |Everyone
! style=max-width:8em rowspan="2" |Room Owner
! style=max-width:8em rowspan="2" |Security Department
! style=max-width:8em rowspan="2" |Private Server Owner
! style=max-width:8em rowspan="2" |Developer
! style=max-width:8em rowspan="2" |Friends or specific players
|-
!Access Level
|-
|Everyone
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|-
|Custom
|{{Cross}}
|{{Tick}}
|{{Tick|color=orange}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|-
|Only Me
|{{Cross}}
|{{Tick}}
|{{Tick|color=orange}}
|{{Tick}}
|{{Tick}}
|{{Cross}}
|}
For each access level, there are three access tiers:
* {{Tick}} - can freely enter the room anytime
* {{Tick|color=orange}} - can only enter the room under special circumstances
* {{Cross}} - cannot enter the room at all
A future update will allow Security personnel to enter Custom-level doors if they have an authorized permit to do so. The authorized permit will be generated by the Security Office and can only be granted if the average Reputation of the Security faction is higher or equal to the Reputation of the room owner that will be entered.
== Locations ==
=== Level 2 East ===
''To be added''
=== Level 3 North ===
''To be added''
=== Level 5 North ===
''To be added''
=== Level 5 South ===
''To be added''
934604405a350e7ae4109f941e768441b999026e
File:TramStation1.png
6
179
396
2022-01-14T04:31:59Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:TramStation2.png
6
180
397
2022-01-14T04:38:01Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Tram system
0
181
398
2022-01-14T04:45:33Z
TheSink
2
Add initial info for tram system (submitting now to preview the page layout)
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|thumb]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''''Area description:''''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
----
[[File:TramStation2.png|thumb]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''''Area description:''' "The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
----
ee0b0b747d999024f8f21445e9a10c5b5c783c7a
399
398
2022-01-14T04:49:37Z
TheSink
2
Test empty lines
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|thumb]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''''Area description:''''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
----
[[File:TramStation2.png|thumb]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''''Area description:''' "The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
----
6640ea5fb2ab478db8735ebe58cec1fcf4bdee2e
400
399
2022-01-14T04:50:49Z
TheSink
2
Use frameless thumbnails
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''''Area description:''''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''''Area description:''' "The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
----
f9950722f7859543cf6b008425fd347916907f89
402
400
2022-01-14T05:03:52Z
TheSink
2
Clean up layout, add more info
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''Area description:''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
==== Nearby Locations ====
* [[Turbine Hall]]
* [[Sector B|Maintenance Wing (Sector B)]]<br />
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''Area description:''' ''"The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
==== Nearby Locations ====
* [[Cargo Bay]]
* [[Sector C West Hall]]
* [[Sector C East Hall]]
----
[[File:TramStation3.png|right|frameless]]
=== Security Checkpoint (Station 3) ===
This is the smallest station along the tram line, primarily because of its low-traffic destination in the freight tunnel [[security checkpoint]]. Riders exiting this station will take an elevator up to the checkpoint on the outgoing side. For authorized personnel such as [[Security (role)|Security]] and the [[Overseer (role)|Overseer]], this also provides access to [[Sector D]] and a maintenance hall connecting the two sides of [[Sector C]] somewhat nearby.
'''Area description:''' ''"The checkpoint securing the freight elevator entrance, the largest access point into the underground sections of the CVRF."''
==== Nearby Locations ====
* [[Freight Checkpoint]]
* [[Sector D]]
* [[Sector C Maintenance Hall]]
* [[Topside Emergency Stairwell]]
7b3cdb4e00d29b675a126af87b911de4e09e6e52
406
402
2022-01-14T05:27:20Z
TheSink
2
Add remaining stations
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''Area description:''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
===== Nearby Locations =====
* [[Turbine Hall]]
* [[Sector B|Maintenance Wing (Sector B)]]<br />
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''Area description:''' ''"The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
===== Nearby Locations =====
* [[Cargo Bay]]
* [[Sector C West Hall]]
* [[Sector C East Hall]]
----
[[File:TramStation3.png|right|frameless]]
=== Security Checkpoint (Station 3) ===
This is the smallest station along the tram line, primarily because of its low-traffic destination in the freight tunnel [[security checkpoint]]. Riders exiting this station will take an elevator up to the checkpoint on the outgoing side. For authorized personnel such as [[Security (role)|Security]] and the [[Overseer (role)|Overseer]], this also provides access to [[Sector D]] and a maintenance hall connecting the two sides of [[Sector C]] somewhat nearby.
'''Area description:''' ''"The checkpoint securing the freight elevator entrance, the largest access point into the underground sections of the CVRF."''
===== Nearby Locations =====
* [[Freight Checkpoint]]
* [[Sector D]]
* [[Sector C Maintenance Hall]]
* [[Topside Emergency Stairwell]]
----
[[File:TramStation4.png|right|frameless]]
=== Sector C East (Station 4) ===
This is a large station serving the eastern half of [[Sector C]].
'''Area description:''' ''"The eastern half of CVRF's Sector C, a location for various laboratories of different functions and fields of study."''
===== Nearby Locations =====
* [[Sector C East Hall]]
* [[Sector B]]
* [[Headcrab Parasitology Lab]]
* [[Clone Lab]]
----
[[File:TramStation5.png|right|frameless]]
=== Sector E Materials (Station 5) ===
This is a large station serving [[Sector E]]. This is also (as of Beta 0.15) the northernmost part of the facility, and is the only station with direct access to bathrooms.
'''Area description:''' ''"This sector supports labs focused on research in materials sciences, and also serves as an overflow locations for new labs if space becomes low in Sector C."''
===== Nearby Locations =====
* [[Sector E]]
* [[Sector B]]
----
=== Sector C West (Station 6) ===
This is a large station providing access to the western half of [[Sector C]]. It is also in close proximity to the southernmost point of [[Sector E]] as it transitions into the Sector C hall, and is also where the transit office that operates the tram line is located.
'''Area description:''' ''"The western half of CVRF's Sector C, a location for various laboratories of different functions and fields of study. The west hall also connects to Sector E."''
===== Nearby Locations =====
* [[Sector C West Hall]]
* [[Sector E]]
* Transit Office
* [[Genetics Lab]]
f95cf0c82de3b897a5a6665664cef811dc95bc39
409
406
2022-01-14T05:36:04Z
TheSink
2
Minor fixes
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''Area description:''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
'''Nearby Locations'''
* [[Turbine Hall]]
* [[Sector B|Maintenance Wing (Sector B)]]<br />
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''Area description:''' ''"The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
'''Nearby Locations'''
* [[Cargo Bay]]
* [[Sector C West Hall]]
* [[Sector C East Hall]]
----
[[File:TramStation3.png|right|frameless]]
=== Security Checkpoint (Station 3) ===
This is the smallest station along the tram line, primarily because of its low-traffic destination in the freight tunnel [[security checkpoint]]. Riders exiting this station will take an elevator up to the checkpoint on the outgoing side. For authorized personnel such as [[Security (role)|Security]] and the [[Overseer (role)|Overseer]], this also provides access to [[Sector D]] and a maintenance hall connecting the two sides of [[Sector C]] somewhat nearby.
'''Area description:''' ''"The checkpoint securing the freight elevator entrance, the largest access point into the underground sections of the CVRF."''
'''Nearby Locations'''
* [[Freight Checkpoint]]
* [[Sector D]]
* [[Sector C Maintenance Hall]]
* [[Topside Emergency Stairwell]]
----
[[File:TramStation4.png|right|frameless]]
=== Sector C East (Station 4) ===
This is a large station serving the eastern half of [[Sector C]].
'''Area description:''' ''"The eastern half of CVRF's Sector C, a location for various laboratories of different functions and fields of study."''
'''Nearby Locations'''
* [[Sector C East Hall]]
* [[Sector B]]
* [[Headcrab Parasitology Lab]]
* [[Clone Lab]]
----
[[File:TramStation5.png|right|frameless]]
=== Sector E Materials (Station 5) ===
This is a large station serving [[Sector E]]. This is also (as of Beta 0.15) the northernmost part of the facility, and is the only station with direct access to bathrooms.
'''Area description:''' ''"This sector supports labs focused on research in materials sciences, and also serves as an overflow locations for new labs if space becomes low in Sector C."''
'''Nearby Locations'''
* [[Sector E]]
* [[Sector B]]
----
[[File:TramStation6.png|right|frameless]]
=== Sector C West (Station 6) ===
This is a large station providing access to the western half of [[Sector C]]. It is also in close proximity to the southernmost point of [[Sector E]] as it transitions into the Sector C hall, and is also where the transit office that operates the tram line is located.
'''Area description:''' ''"The western half of CVRF's Sector C, a location for various laboratories of different functions and fields of study. The west hall also connects to Sector E."''
'''Nearby Locations'''
* [[Sector C West Hall]]
* [[Sector E]]
* Transit Office
* [[Genetics Lab]]
04007fbb72cafc620f5dadf47a4d8e17ac0f98dc
410
409
2022-01-14T05:51:34Z
TheSink
2
Add section for admin parameters
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is a medium-sized station with seating and a water fountain.
'''Area description:''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
'''Nearby Locations'''
* [[Turbine Hall]]
* [[Sector B|Maintenance Wing (Sector B)]]<br />
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is the only one without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''Area description:''' ''"The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
'''Nearby Locations'''
* [[Cargo Bay]]
* [[Sector C West Hall]]
* [[Sector C East Hall]]
----
[[File:TramStation3.png|right|frameless]]
=== Security Checkpoint (Station 3) ===
This is the smallest station along the tram line, primarily because of its low-traffic destination in the freight tunnel [[security checkpoint]]. Riders exiting this station will take an elevator up to the checkpoint on the outgoing side. For authorized personnel such as [[Security (role)|Security]] and the [[Overseer (role)|Overseer]], this also provides access to [[Sector D]] and a maintenance hall connecting the two sides of [[Sector C]] somewhat nearby.
'''Area description:''' ''"The checkpoint securing the freight elevator entrance, the largest access point into the underground sections of the CVRF."''
'''Nearby Locations'''
* [[Freight Checkpoint]]
* [[Sector D]]
* [[Sector C Maintenance Hall]]
* [[Topside Emergency Stairwell]]
----
[[File:TramStation4.png|right|frameless]]
=== Sector C East (Station 4) ===
This is a large station serving the eastern half of [[Sector C]].
'''Area description:''' ''"The eastern half of CVRF's Sector C, a location for various laboratories of different functions and fields of study."''
'''Nearby Locations'''
* [[Sector C East Hall]]
* [[Sector B]]
* [[Headcrab Parasitology Lab]]
* [[Clone Lab]]
----
[[File:TramStation5.png|right|frameless]]
=== Sector E Materials (Station 5) ===
This is a large station serving [[Sector E]]. This is also (as of Beta 0.15) the northernmost part of the facility, and is the only station with direct access to bathrooms.
'''Area description:''' ''"This sector supports labs focused on research in materials sciences, and also serves as an overflow locations for new labs if space becomes low in Sector C."''
'''Nearby Locations'''
* [[Sector E]]
* [[Sector B]]
----
[[File:TramStation6.png|right|frameless]]
=== Sector C West (Station 6) ===
This is a large station providing access to the western half of [[Sector C]]. It is also in close proximity to the southernmost point of [[Sector E]] as it transitions into the Sector C hall, and is also where the transit office that operates the tram line is located.
'''Area description:''' ''"The western half of CVRF's Sector C, a location for various laboratories of different functions and fields of study. The west hall also connects to Sector E."''
'''Nearby Locations'''
* [[Sector C West Hall]]
* [[Sector E]]
* Transit Office
* [[Genetics Lab]]
== Admin controls ==
Certain authorized users (the overseer, private server owners and admins, developers, etc) have access to commands and controls in the transit office to manipulate the tram. They can be manipulated with the "tram" command. Here is a list of parameters:
{| class="wikitable"
!Parameter Name
!Description
|-
|'''moving'''
|Determines whether the tram is currently active and able to move along the line. Setting this to false will cause the tram to come to a controlled stop where ever it is along the track, until it is set to true again.
|-
|'''movementspeed'''
|Controls the multiplier for the speed at which the tram moves. 1 is normal, 0.5 is half, 2 is double, etc. Setting this value too high (i.e. above 15) may result in players being unable to stay in the tram if they are not seated, especially if they are running at a low framerate.
|-
|'''skipstops'''
|If enabled, the tram will not stop at any stations until the parameter is disabled again. This parameter may be changed in the future to support skipping specific stations (and not others) instead of being a global toggle.
|-
|'''stopduration'''
|The length (in seconds) that the tram will remain at any given station. Default is 7 seconds.
|}
c6e2cf89b371def5c1cbb46973cbde7d5c65935e
411
410
2022-01-14T06:37:21Z
ChromeEight
7
/* Stations */ Corrected platform screen doors
wikitext
text/x-wiki
{{Page under construction}}{{Work in progress}}
The '''tram system''' is a form of automated passenger transportation that moves players between six stations placed around the facility. It is partially inspired by the ''[https://half-life.fandom.com/wiki/Black_Mesa_Transit_System Black Mesa Transit System].''
== Stations ==
[[File:TramStation1.png|right|frameless]]
=== Sector A Sublevel (Station 1) ===
This station is connected to the [[Lower Atrium]] in [[Sector A]], and is the only station to be officially placed in this sector of the facility. It is one of two stations without platform screen doors (due to complications on the location of the emergency exits) and is a medium-sized station with seating and a water fountain.
'''Area description:''' ''"This area (and the entirety of Level 1) is dedicated to the operation of the CVRF geothermal power plant to supply power to the facility and its many experiments."''
'''Nearby Locations'''
* [[Turbine Hall]]
* [[Sector B|Maintenance Wing (Sector B)]]<br />
----
[[File:TramStation2.png|right|frameless]]
=== Cargo Bay (Station 2) ===
This station is technically on [[Level 1]], but provides direct access to the [[Cargo Bay]] using an elevator and stairwell. It is unique in its curved design, and is one of two stations without platform screen doors (due to the complications introduced by this curved design). It is a fairly small station.
'''Area description:''' ''"The primary artery for receiving cargo from the surface. Also a location to temporarily store resources before they are distributed."''
'''Nearby Locations'''
* [[Cargo Bay]]
* [[Sector C West Hall]]
* [[Sector C East Hall]]
----
[[File:TramStation3.png|right|frameless]]
=== Security Checkpoint (Station 3) ===
This is the smallest station along the tram line, primarily because of its low-traffic destination in the freight tunnel [[security checkpoint]]. Riders exiting this station will take an elevator up to the checkpoint on the outgoing side. For authorized personnel such as [[Security (role)|Security]] and the [[Overseer (role)|Overseer]], this also provides access to [[Sector D]] and a maintenance hall connecting the two sides of [[Sector C]] somewhat nearby.
'''Area description:''' ''"The checkpoint securing the freight elevator entrance, the largest access point into the underground sections of the CVRF."''
'''Nearby Locations'''
* [[Freight Checkpoint]]
* [[Sector D]]
* [[Sector C Maintenance Hall]]
* [[Topside Emergency Stairwell]]
----
[[File:TramStation4.png|right|frameless]]
=== Sector C East (Station 4) ===
This is a large station serving the eastern half of [[Sector C]].
'''Area description:''' ''"The eastern half of CVRF's Sector C, a location for various laboratories of different functions and fields of study."''
'''Nearby Locations'''
* [[Sector C East Hall]]
* [[Sector B]]
* [[Headcrab Parasitology Lab]]
* [[Clone Lab]]
----
[[File:TramStation5.png|right|frameless]]
=== Sector E Materials (Station 5) ===
This is a large station serving [[Sector E]]. This is also (as of Beta 0.15) the northernmost part of the facility, and is the only station with direct access to bathrooms.
'''Area description:''' ''"This sector supports labs focused on research in materials sciences, and also serves as an overflow locations for new labs if space becomes low in Sector C."''
'''Nearby Locations'''
* [[Sector E]]
* [[Sector B]]
----
[[File:TramStation6.png|right|frameless]]
=== Sector C West (Station 6) ===
This is a large station providing access to the western half of [[Sector C]]. It is also in close proximity to the southernmost point of [[Sector E]] as it transitions into the Sector C hall, and is also where the transit office that operates the tram line is located.
'''Area description:''' ''"The western half of CVRF's Sector C, a location for various laboratories of different functions and fields of study. The west hall also connects to Sector E."''
'''Nearby Locations'''
* [[Sector C West Hall]]
* [[Sector E]]
* Transit Office
* [[Genetics Lab]]
== Admin controls ==
Certain authorized users (the overseer, private server owners and admins, developers, etc) have access to commands and controls in the transit office to manipulate the tram. They can be manipulated with the "tram" command. Here is a list of parameters:
{| class="wikitable"
!Parameter Name
!Description
|-
|'''moving'''
|Determines whether the tram is currently active and able to move along the line. Setting this to false will cause the tram to come to a controlled stop where ever it is along the track, until it is set to true again.
|-
|'''movementspeed'''
|Controls the multiplier for the speed at which the tram moves. 1 is normal, 0.5 is half, 2 is double, etc. Setting this value too high (i.e. above 15) may result in players being unable to stay in the tram if they are not seated, especially if they are running at a low framerate.
|-
|'''skipstops'''
|If enabled, the tram will not stop at any stations until the parameter is disabled again. This parameter may be changed in the future to support skipping specific stations (and not others) instead of being a global toggle.
|-
|'''stopduration'''
|The length (in seconds) that the tram will remain at any given station. Default is 7 seconds.
|}
b9a780d32f46f969e7e4d72761f9afaa6797038f
File:TramStation3.png
6
182
401
2022-01-14T05:00:44Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:TramStation4.png
6
183
403
2022-01-14T05:09:42Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:TramStation5.png
6
184
404
2022-01-14T05:11:35Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:TramStation6.png
6
185
405
2022-01-14T05:17:31Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Main Page
0
1
407
263
2022-01-14T05:29:14Z
TheSink
2
Add contribution note
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first. <!-- Someone edit in a sentence in CVRF_Wiki: Disclaimers about how being a Contributor will NOT give you any credit or roles in-game or in the discord server. Being a Wiki Contributor is a volunteering job and specifically says that on the main Wikipedia page when you sign up as a contributor. Also if you think this is dumb, ask someone with below 70 IQ. -->
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
Looking for ways to contribute? Consider checking the [[Special:WantedPages]] page for a list of all redirects on the wiki that currently lead to empty articles.
=== Version Info ===
The latest public build of CVRF is '''Beta 14.1'''. Development of '''Beta 15.0''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
bb6defb74e0fafbb8605b98fb95c3df071b65a16
412
407
2022-01-14T18:05:59Z
TheSink
2
Add banner
wikitext
text/x-wiki
__NOTOC__
[[File:MainPageBanner.png|center|frameless|960x960px]]
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first.
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
Looking for ways to contribute? Consider checking the [[Special:WantedPages]] page for a list of all redirects on the wiki that currently lead to empty articles.
=== Version Info ===
The latest public build of CVRF is '''Beta 14.1'''. Development of '''Beta 15.0''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
17c34657de25019e5bfa5237cf26c6acfac6a23a
414
412
2022-01-14T18:13:44Z
TheSink
2
Reverted edits by [[Special:Contributions/TheSink|TheSink]] ([[User talk:TheSink|talk]]) to last revision by [[User:ChromeEight|ChromeEight]]
wikitext
text/x-wiki
__NOTOC__
Welcome to the CVRF Wiki, where you can find a host of information about the game's locations, mechanics, history, and more. This wiki is currently a major work-in-progress and needs contributors - if you feel you're familiar with the game enough and have decent writing skills, feel free to start writing articles! Simply make an account and be sure to read our [[Rules]] first. <!-- Someone edit in a sentence in CVRF_Wiki: Disclaimers about how being a Contributor will NOT give you any credit or roles in-game or in the discord server. Being a Wiki Contributor is a volunteering job and specifically says that on the main Wikipedia page when you sign up as a contributor. Also if you think this is dumb, ask someone with below 70 IQ. -->
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 14.1'''. Development of '''Beta 15.0''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
6eb81a203de9078a2f816f31b09b1cd1ee5b764c
File:MainPageBanner.png
6
186
408
2022-01-14T05:29:58Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FireBanner.png
6
187
413
2022-01-14T18:07:58Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Cafeteria
0
112
415
261
2022-01-16T05:37:12Z
TheSink
2
TheSink moved page [[Cafeteria (location)]] to [[Cafeteria]] without leaving a redirect: Remove location suffix from title
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
[[Category:Locations]]
9083eb6a09dd8d7d52ba219c7633c9671ded2de1
MediaWiki:Custom-RcGcDw
8
188
416
2022-01-16T05:56:11Z
TheSink
2
Created page with "172576788839530497"
wikitext
text/x-wiki
172576788839530497
d775c4408dd128836f3440e83027929e2eecf81a
User talk:TheSink
3
189
417
2022-01-16T05:59:35Z
TheSink
2
Created page with "Testing discord webhook ~~~~"
wikitext
text/x-wiki
Testing discord webhook [[User:TheSink|TheSink]] ([[User talk:TheSink|talk]]) 05:59, 16 January 2022 (UTC)
a7410eb154fb790245ee8c84269178045fee9176
Reception lobby
0
15
418
242
2022-01-16T06:08:40Z
TheSink
2
TheSink moved page [[Reception Lobby (location)]] to [[Reception Lobby]] without leaving a redirect: Remove location suffix from title
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Reception lobby 15.png|frameless|right|The reception area in the upcoming Beta 0.15 update.]]
The '''Reception Lobby''' is a location on [[Level 5]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
== History ==
[[File:Reception lobby really old.png|thumb|left|The reception lobby in early Beta 0.7.]]
[[File:Reception lobby 11.png|thumb|left|The reception area in a dev build for Beta 0.11.]]
=== Beta 0.7 ===
In JKRF Beta 0.7, part of the office-themed administration area on Level 4 was carved out into a reception lobby with a few rows of waiting benches. It was initially intended as a joke where people can wait for the long-delayed release and opening of the Pinewood Oil Platform, another JKR game in development at the time.
Offices for high-ranking JKR administration members were originally located adjacent to the Reception Lobby, which were later replaced by a conference room. A ceiling turret was also formerly located in the reception lobby, which was removed in a later update.
=== Beta 0.9 ===
The redesign of the [[Atrium]] in Beta 0.9 added an upper level to the Atrium at the same level as the Reception Lobby, providing access between the reception area and the Atrium. New benches were also added around this time.
=== Beta 0.12 ===
During the Foundation Update, a second level was added to the lab hallways, which changed the Atrium upper level to Level 5. As a result, the floor level that the Reception Lobby is located at was also changed to Level 5. In this update, the administration area's hallway colors were made more brown, with the Reception Lobby alongside it.
=== ''Beta 0.15'' ===
Additional plants and some trash bins will be added in the upcoming Beta 0.15 update.
[[Category:Locations]]
195989fbcc29a48ba5c4058ea4334b5412c385ed
424
418
2022-01-16T21:25:16Z
TheSink
2
TheSink moved page [[Reception Lobby]] to [[Reception lobby]] without leaving a redirect: Switch to sentence case
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Reception lobby 15.png|frameless|right|The reception area in the upcoming Beta 0.15 update.]]
The '''Reception Lobby''' is a location on [[Level 5]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
== History ==
[[File:Reception lobby really old.png|thumb|left|The reception lobby in early Beta 0.7.]]
[[File:Reception lobby 11.png|thumb|left|The reception area in a dev build for Beta 0.11.]]
=== Beta 0.7 ===
In JKRF Beta 0.7, part of the office-themed administration area on Level 4 was carved out into a reception lobby with a few rows of waiting benches. It was initially intended as a joke where people can wait for the long-delayed release and opening of the Pinewood Oil Platform, another JKR game in development at the time.
Offices for high-ranking JKR administration members were originally located adjacent to the Reception Lobby, which were later replaced by a conference room. A ceiling turret was also formerly located in the reception lobby, which was removed in a later update.
=== Beta 0.9 ===
The redesign of the [[Atrium]] in Beta 0.9 added an upper level to the Atrium at the same level as the Reception Lobby, providing access between the reception area and the Atrium. New benches were also added around this time.
=== Beta 0.12 ===
During the Foundation Update, a second level was added to the lab hallways, which changed the Atrium upper level to Level 5. As a result, the floor level that the Reception Lobby is located at was also changed to Level 5. In this update, the administration area's hallway colors were made more brown, with the Reception Lobby alongside it.
=== ''Beta 0.15'' ===
Additional plants and some trash bins will be added in the upcoming Beta 0.15 update.
[[Category:Locations]]
195989fbcc29a48ba5c4058ea4334b5412c385ed
Atrium
0
109
419
248
2022-01-16T06:12:08Z
TheSink
2
Add Location category
wikitext
text/x-wiki
The Atrium is the central hub of the facility, spanning several levels and connecting multiple hallways.
== Development history ==
The Atrium was added sometime between Beta 0.5 and Beta 0.6, when Levels 3 and 4 were added to the game. It was an high-ceiling area on Level 3 connected to staircases to and from the laboratories on Level 2 and the administrative areas on Level 3. A cafeteria was added, which was accessible via the Atrium. A turret was also located at the center of the Atrium ceiling.
In Beta 0.9, the Atrium was completely redesigned and divided into distinct levels at Level 1, 2, and 3, with a close resemblance to Vaults found in the games ''Fallout 3'' and ''Fallout: New Vegas''. In this redesign, the Atrium staircase was redesigned and divided, wherein the staircase to Level 3 was relocated to the east side, while the staircase to Level 1 remained at the north side.
With the labs being at the same level as the Atrium, the south side of the Atrium provided access to the Blue and Orange lab hallways. An emergency access door to and from the Orange Hallway was located at the base of the Atrium staircase to Level 3.
In Beta 0.11, the Cafeteria was relocated from Level 2 to Level 3, now being located on the former location of the Control Room. As a result, the Control Room was subsequently relocated northwest of the Atrium, with access being provided by the west side of the upper Atrium. This allowed both sides of the Atrium to be mirrored.
In the Foundation Update, the Blue and Orange lab hallways were redesigned as Sector C West and Sector C East, respectively, each with two levels of laboratories and other rooms. As a result, the Atrium was slightly raised, and the upper level was reclassified as Level 5, while the lower level was reclassified as Level 3. The Atrium ceiling was also slightly raised.
In the Recursive Update, the hallway leading to the Control Room was merged into the Sector D hallway. A disco easter egg was also added.
== Levels ==
=== Level 1 ===
The lowest level of the Atrium is a dark area with catwalks that provide access to the facility sublevel. This level of the Atrium is connected to the Geothermal Sublevel Station of the Transit System. It is currently in the process of dismantling its former reactor infrastructure.
=== Level 3 ===
The middle level of the Atrium is an open area connected to the Atrium staircase for Level 2 and Level 5, the Atrium Lounge, and a janitor's closet. It also connects to a nook located in between the Atrium restrooms, providing access to Sector C West and Sector C East.
=== Level 5 ===
The highest level of the Atrium on this level consists of a U-shaped hallway overlooking the Level 3 Atrium, which branches out into the Control Room, the Atrium staircase, the Security Area, the [[Reception Lobby (location)|Reception Lobby]], and the Cafeteria.
[[Category:Locations]]
124268c1855a4130baed3306886ced1df29e5cfd
Food Labs
0
108
420
247
2022-01-16T06:12:26Z
TheSink
2
Add Location category
wikitext
text/x-wiki
The '''Food Labs''' was a laboratory located on Level 2. It was the first lab ever added to the game and was suggested by user Shredder914.
The lab contained several tables and a machine that would produce synthetic bananas onto a conveyor belt and subsequently incinerate them. A broom was kept on the wall in the event that the synthetic bananas spilled out of the conveyor belt.
An unofficial preserved copy of the Food Labs can be found [https://www.roblox.com/games/1932480100/The-Food-Lab-from-HTRF-0-11 here].
== Development history ==
In Alpha and early Beta builds, the Food Labs was located along a hallway between the Atrium staircase and the hallway fork going to the looped hallway towards the other labs on Level 2.
When the [[Atrium]] and lab hallways were redesigned in Beta 0.8, the Food Labs was moved to the Blue Hallway as the sole lab in the Food Science nook. However, in Beta 0.11, the Food Labs was removed from the game in an effort to clean up the lab lineup in the facility.
[[Category:Locations]]
a57c02f9350d43bc3caf18c0da7b2bec5e963cbc
List of current and former developers
0
107
421
264
2022-01-16T06:14:25Z
TheSink
2
Fix wiki username
wikitext
text/x-wiki
This is a complete list of all current and former developers of JKR Productions that have worked on the Cobalt Valley Research Facility and its iterations.
== Current developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| ChromeEight || Game creator, level design, programmer, graphic design || 2015-2018, 2020-present || [[User:ChromeEight|ChromeEight]]
|-
| The_Sink || Level design, programmer, graphic design, backend systems, external systems || 2016-2018, 2020-present || [[User:TheSink|TheSink]]
|-
| LouieK22 || Programmer, backend systems, framework creator, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShoesForClues || Model design, programmer, backend systems, advisor || 2016-2018 (developer), 2020-present (advisor) || N/A
|-
| ShipMaster_Caine || Programmer, model design || 2021-present (inactive) || N/A
|}
== Former developers ==
{| class="wikitable"
|-
! Roblox Username !! Nature of work !! Years active !! Wiki Username
|-
| lavafactory || Model design, level design, graphic design || 2016-2018, 2020-2021 || N/A
|-
| Architect_Build || Model design, level design || 2017-2018 || N/A
|-
| xUsagi || Model design || 2017-2018 || N/A
|-
| nathanpn || Level design, model design || 2017-2018 || N/A
|-
| TheCakeChicken || Programmer, backend systems || 2018-2019 || N/A
|-
| systemise || Programmer || 2018 || N/A
|-
| Kezzera || Model design || 2018 || N/A
|}
58978736b632a809794a64ab28a97eb7a8194161
User:TheSink
2
18
422
195
2022-01-16T06:16:00Z
TheSink
2
Remove test template
wikitext
text/x-wiki
Hello! I'm a CVRF developer and owner of this wiki. You can contact me on Discord at ''The_Sink#4096''.
62fa07d0f0abd04e17d88d06a8d6fef147636ff1
Living quarters
0
178
423
395
2022-01-16T12:07:14Z
ChromeEight
7
/* Access levels */ typo
wikitext
text/x-wiki
The '''Living quarters''' are upcoming several locations around the facility where players will be able to claim as their own personal quarters.
==Features==
=== Unowned and owned rooms ===
Any unowned room can be rented by the player for the duration of their stay in the server. A room can be set to unowned anytime after owning one.
=== Room customizations ===
''To be added''
===Access levels===
Players will be able to control who is able to go in and out of their quarters through different access levels, outlined below:
{| class="wikitable"
|+Room Access Levels
!Roles
! style=max-width:8em rowspan="2" |Everyone
! style=max-width:8em rowspan="2" |Room Owner
! style=max-width:8em rowspan="2" |Security Department
! style=max-width:8em rowspan="2" |Private Server Owner
! style=max-width:8em rowspan="2" |Developer
! style=max-width:8em rowspan="2" |Friends or specific players
|-
!Access Level
|-
|Everyone
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|-
|Custom
|{{Cross}}
|{{Tick}}
|{{Tick|color=orange}}
|{{Tick}}
|{{Tick}}
|{{Tick}}
|-
|Only Me
|{{Cross}}
|{{Tick}}
|{{Tick|color=orange}}
|{{Tick}}
|{{Tick}}
|{{Cross}}
|}
For each access level, there are three access tiers:
* {{Tick}} - can freely enter the room anytime
* {{Tick|color=orange}} - can only enter the room under special circumstances
* {{Cross}} - cannot enter the room at all
A future update will allow Security personnel to enter restricted doors if they have an authorized permit to do so. The authorized permit will be generated by the Security Office and can only be granted if the average Reputation of the Security faction is higher or equal to the Reputation of the room owner that will be entered.
== Locations ==
=== Level 2 East ===
''To be added''
=== Level 3 North ===
''To be added''
=== Level 5 North ===
''To be added''
=== Level 5 South ===
''To be added''
dcdc2fea8b84702a809f7543d651e19c24d4b5ab
Template:Infobox location
10
190
425
2022-01-17T03:51:08Z
TheSink
2
Create test location infobox
wikitext
text/x-wiki
<div class="infobox">
<div class="infobox-title">{{{title|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|
<div class="infobox-image">[[File:{{{image}}}|300px]]</div>}}
<table>{{#if:{{{location|}}}|<tr>
<th>Location</th>
<td>{{{location}}}</td>
</tr>}}</table>
</div>
ee7fa05ff89370c07c9dbc1b6b6cb496a6b8e894
MediaWiki:Common.css
8
10
426
270
2022-01-17T03:54:36Z
TheSink
2
Edit infobox CSS
css
text/css
/* Reset italic styling set by user agent */
cite,
dfn {
font-style: inherit;
}
/* Straight quote marks for <q> */
q {
quotes: '"' '"' "'" "'";
}
/* Avoid collision of blockquote with floating elements by swapping margin and padding */
blockquote {
overflow: hidden;
margin: 1em 0;
padding: 0 40px;
}
/* Consistent size for <small>, <sub> and <sup> */
small {
font-size: 85%;
}
.mw-body-content sub,
.mw-body-content sup,
span.reference /* for Parsoid */ {
font-size: 80%;
}
/* Same spacing for indented and unindented paragraphs on talk pages */
.ns-talk .mw-body-content dd {
margin-top: 0.4em;
margin-bottom: 0.4em;
}
/* Main page fixes */
#interwiki-completelist {
font-weight: bold;
}
/* Reduce page jumps by hiding collapsed/dismissed content */
.client-js .mw-special-Watchlist #watchlist-message,
.client-js .collapsible:not( .mw-made-collapsible).collapsed > tbody > tr:not(:first-child),
/* Hide charinsert base for those not using the gadget */
#editpage-specialchars {
display: none;
}
/* Adds padding above Watchlist announcements where new recentchanges/watchlist filters are enabled */
.mw-rcfilters-enabled .mw-specialpage-summary {
margin-top: 1em;
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
background-color: rgba(0, 127, 255, 0.133);
}
/* Styling for citations. Breaks long urls, etc., rather than overflowing box */
.citation {
word-wrap: break-word;
}
/* Make the list of references smaller
* Keep in sync with Template:Refbegin/styles.css
* And Template:Reflist/styles.css
*/
ol.references {
font-size: 90%;
margin-bottom: 0.5em;
}
/* Style for horizontal lists (separator following item).
@source mediawiki.org/wiki/Snippets/Horizontal_lists
@revision 8 (2016-05-21)
@author [[User:Edokter]]
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
margin: 0; /* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again */
display: inline;
}
/* Display nested lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* Generate interpuncts */
.hlist dt:after {
content: ": ";
}
/**
* Note hlist style usage differs in Minerva and is defined in core as well!
* Please check Minerva desktop (and Minerva.css) when changing
* See https://phabricator.wikimedia.org/T213239
*/
.hlist dd:after,
.hlist li:after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child:before,
.hlist dd dt:first-child:before,
.hlist dd li:first-child:before,
.hlist dt dd:first-child:before,
.hlist dt dt:first-child:before,
.hlist dt li:first-child:before,
.hlist li dd:first-child:before,
.hlist li dt:first-child:before,
.hlist li li:first-child:before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child:after,
.hlist dd dt:last-child:after,
.hlist dd li:last-child:after,
.hlist dt dd:last-child:after,
.hlist dt dt:last-child:after,
.hlist dt li:last-child:after,
.hlist li dd:last-child:after,
.hlist li dt:last-child:after,
.hlist li li:last-child:after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li:before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
/* Styling for JQuery makeCollapsible, matching that of collapseButton */
.mw-parser-output .mw-collapsible-toggle {
font-weight: normal;
/* @noflip */
text-align: right;
padding-right: 0.2em;
padding-left: 0.2em;
}
.mw-collapsible-leftside-toggle .mw-collapsible-toggle {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
}
/* Infobox template style */
.infobox {
background: #eee;
border: 1px solid #aaa;
float: right;
margin: 0 0 1em 1em;
padding: 1em;
width: 400px;
}
.infobox-title {
font-size: 2em;
text-align: center;
}
.infobox-image {
text-align: center;
}
.infobox th {
text-align: right;
vertical-align: top;
width: 120px;
}
.infobox td {
vertical-align: top;
}
/* Normal font styling for wikitable row headers with scope="row" tag */
.wikitable.plainrowheaders th[scope=row] {
font-weight: normal;
/* @noflip */
text-align: left;
}
/* Lists in wikitable data cells are always left-aligned */
.wikitable td ul,
.wikitable td ol,
.wikitable td dl {
/* @noflip */
text-align: left;
}
/* Fix for hieroglyphs specificity issue in infoboxes ([[phab:T43869]]) */
table.mw-hiero-table td {
vertical-align: middle;
}
/* Change the external link icon to an Adobe icon for all PDF files */
.mw-parser-output a[href$=".pdf"].external,
.mw-parser-output a[href*=".pdf?"].external,
.mw-parser-output a[href*=".pdf#"].external,
.mw-parser-output a[href$=".PDF"].external,
.mw-parser-output a[href*=".PDF?"].external,
.mw-parser-output a[href*=".PDF#"].external {
background: url("//upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif") no-repeat right;
/* @noflip */
padding-right: 18px;
}
/* Messagebox templates */
.messagebox {
border: 1px solid #a2a9b1;
background-color: #f8f9fa;
width: 80%;
margin: 0 auto 1em auto;
padding: .2em;
}
.messagebox.cleanup {
border: 1px solid #9f9fff;
background-color: #efefff;
text-align: center;
}
.messagebox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
width: 100%;
margin: 2px 0;
padding: 2px;
}
.messagebox.small {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
}
.messagebox.small-talk {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
background-color: #f8eaba;
}
/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
th.mbox-text, td.mbox-text { /* The message body cell(s) */
border: none;
/* @noflip */
padding: 0.25em 0.9em; /* 0.9em left/right */
width: 100%; /* Make all mboxes the same width regardless of text length */
}
td.mbox-image { /* The left image cell */
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em; /* 0.9em left, 0px right */
text-align: center;
}
td.mbox-imageright { /* The right image cell */
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0; /* 0px left, 0.9em right */
text-align: center;
}
td.mbox-empty-cell { /* An empty narrow cell */
border: none;
padding: 0;
width: 1px;
}
/* Article message box styles */
table.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
/* Single border between stacked boxes. */
table.ambox + table.ambox,
table.ambox + .mw-empty-elt + table.ambox {
margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text { /* The message body cell(s) */
padding: 0.25em 0.5em; /* 0.5em left/right */
}
.ambox td.mbox-image { /* The left image cell */
/* @noflip */
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright { /* The right image cell */
/* @noflip */
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
}
table.ambox-notice {
/* @noflip */
border-left: 10px solid #36c; /* Blue */
}
table.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
table.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
table.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
table.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
table.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
/* Image message box styles */
table.imbox {
margin: 4px 10%;
border-collapse: collapse;
border: 3px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
.imbox .mbox-text .imbox { /* For imboxes inside imbox-text cells. */
margin: 0 -0.5em; /* 0.9 - 0.5 = 0.4em left/right. */
display: block; /* Fix for webkit to force 100% width. */
}
.mbox-inside .imbox { /* For imboxes inside other templates. */
margin: 4px;
}
table.imbox-notice {
border: 3px solid #36c; /* Blue */
}
table.imbox-speedy {
border: 3px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.imbox-delete {
border: 3px solid #b32424; /* Red */
}
table.imbox-content {
border: 3px solid #f28500; /* Orange */
}
table.imbox-style {
border: 3px solid #fc3; /* Yellow */
}
table.imbox-move {
border: 3px solid #9932cc; /* Purple */
}
table.imbox-protection {
border: 3px solid #a2a9b1; /* Gray-gold */
}
table.imbox-license {
border: 3px solid #88a; /* Dark gray */
background-color: #f7f8ff; /* Light gray */
}
table.imbox-featured {
border: 3px solid #cba135; /* Brown-gold */
}
/* Category message box styles */
table.cmbox {
margin: 3px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1;
background-color: #dfe8ff; /* Default "notice" blue */
box-sizing: border-box;
}
table.cmbox-notice {
background-color: #d8e8ff; /* Blue */
}
table.cmbox-speedy {
margin-top: 4px;
margin-bottom: 4px;
border: 4px solid #b32424; /* Red */
background-color: #ffdbdb; /* Pink */
}
table.cmbox-delete {
background-color: #ffdbdb; /* Pink */
}
table.cmbox-content {
background-color: #ffe7ce; /* Orange */
}
table.cmbox-style {
background-color: #fff9db; /* Yellow */
}
table.cmbox-move {
background-color: #e4d8ff; /* Purple */
}
table.cmbox-protection {
background-color: #efefe1; /* Gray-gold */
}
/* Other pages message box styles */
table.ombox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
table.ombox-notice {
border: 1px solid #a2a9b1; /* Gray */
}
table.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ombox-delete {
border: 2px solid #b32424; /* Red */
}
table.ombox-content {
border: 1px solid #f28500; /* Orange */
}
table.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
table.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
table.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #c0c090; /* Default "notice" gray-brown */
background-color: #f8eaba;
min-width: 80%;
box-sizing: border-box;
}
.tmbox.mbox-small {
min-width: 0; /* reset the min-width of tmbox above */
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" class ensures that */
margin: 2px 0; /* this declaration overrides other styles (including mbox-small above) */
width: 100%; /* For Safari and Opera */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when */
line-height: 1.5em; /* also "nested", so reset styles that are */
font-size: 100%; /* set in "mbox-small" above. */
}
table.tmbox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.tmbox-delete {
border: 2px solid #b32424; /* Red */
}
table.tmbox-content {
border: 2px solid #f28500; /* Orange */
}
table.tmbox-style {
border: 2px solid #fc3; /* Yellow */
}
table.tmbox-move {
border: 2px solid #9932cc; /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
border: 1px solid #c0c090; /* Gray-brown */
}
/* Footer and header message box styles */
table.fmbox {
clear: both;
margin: 0.2em 0;
width: 100%;
border: 1px solid #a2a9b1;
background-color: #f8f9fa; /* Default "system" gray */
box-sizing: border-box;
}
table.fmbox-system {
background-color: #f8f9fa;
}
table.fmbox-warning {
border: 1px solid #bb7070; /* Dark pink */
background-color: #ffdbdb; /* Pink */
}
table.fmbox-editnotice {
background-color: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon,
div.titleblacklist-warning {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* Use default color for partial block fmbox banner per [[Special:PermaLink/1028105567#pblock-style]] */
.mw-contributions-blocked-notice-partial .mw-warning-with-logexcerpt {
border-color: #fc3;
background-color: #fef6e7;
}
/* These mbox-small classes must be placed after all other
ambox/tmbox/ombox etc classes. "html body.mediawiki" is so
they override "table.ambox + table.ambox" above. */
html body.mediawiki .mbox-small { /* For the "small=yes" option. */
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
box-sizing: border-box;
width: 238px;
font-size: 88%;
line-height: 1.25em;
}
html body.mediawiki .mbox-small-left { /* For the "small=left" option. */
/* @noflip */
margin: 4px 1em 4px 0;
box-sizing: border-box;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
/* Style for compact ambox */
/* Hide the images */
.compact-ambox table .mbox-image,
.compact-ambox table .mbox-imageright,
.compact-ambox table .mbox-empty-cell {
display: none;
}
/* Remove borders, backgrounds, padding, etc. */
.compact-ambox table.ambox {
border: none;
border-collapse: collapse;
background-color: transparent;
margin: 0 0 0 1.6em !important;
padding: 0 !important;
width: auto;
display: block;
}
body.mediawiki .compact-ambox table.mbox-small-left {
font-size: 100%;
width: auto;
margin: 0;
}
/* Style the text cell as a list item and remove its padding */
.compact-ambox table .mbox-text {
padding: 0 !important;
margin: 0 !important;
}
.compact-ambox table .mbox-text-span {
display: list-item;
line-height: 1.5em;
list-style-type: square;
list-style-image: url(/w/skins/MonoBook/resources/images/bullet.svg);
}
/* Allow for hiding text in compact form */
.compact-ambox .hide-when-compact {
display: none;
}
/* Remove underlines from certain links */
.nounderlines a,
.IPA a:link,
.IPA a:visited {
text-decoration: none !important;
}
/* Prevent line breaks in silly places where desired (nowrap)
and links when we don't want them to (nowraplinks a) */
.nowrap,
.nowraplinks a {
white-space: nowrap;
}
/* But allow wrapping where desired: */
.wrap,
.wraplinks a {
white-space: normal;
}
/* Increase the height of the image upload box */
#wpUploadDescription {
height: 13em;
}
/* Minimum thumb width */
.thumbinner {
min-width: 100px;
}
/* Prevent floating boxes from overlapping any category listings,
file histories, edit previews, and edit [Show changes] views. */
#mw-subcategories,
#mw-pages,
#mw-category-media,
#filehistory,
#wikiPreview,
#wikiDiff {
clear: both;
}
/* Selectively hide headers in WikiProject banners */
/* TemplateStyles */
.wpb .wpb-header {
display: none;
}
.wpbs-inner .wpb .wpb-header {
display: table-row;
}
.wpbs-inner .wpb-outside {
display: none; /* hide things that should only display outside shells */
}
/* Styling for Abuse Filter tags */
.mw-tag-markers {
font-style: italic;
font-size: 90%;
}
/* Hide stuff meant for accounts with special permissions. Made visible again in
[[MediaWiki:Group-checkuser.css]], [[MediaWiki:Group-sysop.css]], [[MediaWiki:Group-abusefilter.css]],
[[MediaWiki:Group-abusefilter-helper.css]], [[MediaWiki:Group-patroller.css]],
[[MediaWiki:Group-templateeditor.css]], [[MediaWiki:Group-extendedmover.css]],
[[MediaWiki:Group-extendedconfirmed.css]], and [[Mediawiki:Group-autoconfirmed.css]]. */
.checkuser-show,
.sysop-show,
.abusefilter-show,
.abusefilter-helper-show,
.patroller-show,
.templateeditor-show,
.extendedmover-show,
.extendedconfirmed-show,
.autoconfirmed-show,
.user-show {
display: none;
}
/* Hide the redlink generated by {{Editnotice}},
this overrides the ".sysop-show { display: none; }" above that applies
to the same link as well. See [[phab:T45013]]
Hide the images in editnotices to keep them readable in VE view.
Long term, editnotices should become a core feature so that they can be designed responsive. */
.ve-ui-mwNoticesPopupTool-item .editnotice-redlink,
.ve-ui-mwNoticesPopupTool-item .mbox-image,
.ve-ui-mwNoticesPopupTool-item .mbox-imageright {
display: none !important;
}
/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors > li {
list-style: none none;
}
ul.permissions-errors {
margin: 0;
}
/* texhtml class for inline math (based on generic times-serif class) */
span.texhtml {
font-family: "Nimbus Roman No9 L", "Times New Roman", Times, serif;
font-size: 118%;
line-height: 1;
white-space: nowrap;
/* Force tabular and lining display for texhtml */
-moz-font-feature-settings: "lnum", "tnum", "kern" 0;
-webkit-font-feature-settings: "lnum", "tnum", "kern" 0;
font-feature-settings: "lnum", "tnum", "kern" 0;
font-variant-numeric: lining-nums tabular-nums;
font-kerning: none;
}
span.texhtml span.texhtml {
font-size: 100%;
}
span.mwe-math-mathml-inline {
font-size: 118%;
}
/* Make <math display="block"> be left aligned with one space indent for
* compatibility with style conventions
*/
.mwe-math-fallback-image-display,
.mwe-math-mathml-display {
margin-left: 1.6em !important;
margin-top: 0.6em;
margin-bottom: 0.6em;
}
.mwe-math-mathml-display math {
display: inline;
}
/* Work-around for [[phab:T25965]] / [[phab:T100106]] (Kaltura advertisement) */
.k-player .k-attribution {
visibility: hidden;
}
/* Move 'play' button of video player to bottom left corner */
.PopUpMediaTransform a .play-btn-large {
margin: 0;
top: auto;
right: auto;
bottom: 0;
left: 0;
}
@media screen {
/* Gallery styles background changes are restricted to screen view.
In printing we should avoid applying backgrounds. */
/* The backgrounds for galleries. */
#content .gallerybox div.thumb {
/* Light gray padding */
background-color: #f8f9fa;
}
/* Put a chequered background behind images, only visible if they have transparency.
'.filehistory a img' and '#file img:hover' are handled by MediaWiki core (as of 1.19) */
.gallerybox .thumb img {
background: #fff url(//upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png) repeat;
}
/* But not on articles, user pages, portals or with opt-out. */
.ns-0 .gallerybox .thumb img,
.ns-2 .gallerybox .thumb img,
.ns-100 .gallerybox .thumb img,
.nochecker .gallerybox .thumb img {
background-image: none;
}
/* Display "From Wikipedia, the free encyclopedia" in skins that support it,
do not apply to print mode */
#siteSub {
display: block;
}
}
/* Hide FlaggedRevs notice UI when there are no pending changes */
.flaggedrevs_draft_synced,
.flaggedrevs_stable_synced,
/* "Temporary" to remove links in sidebar T255381 */
#t-upload,
/* Hide broken download box on Special:Book pending T285400 */
.mw-special-Book #coll-downloadbox {
display: none;
}
84aa624069cacc1b6d22928148938293773774ed
427
426
2022-01-17T03:57:15Z
TheSink
2
Undo revision 426 by [[Special:Contributions/TheSink|TheSink]] ([[User talk:TheSink|talk]])
css
text/css
/* Reset italic styling set by user agent */
cite,
dfn {
font-style: inherit;
}
/* Straight quote marks for <q> */
q {
quotes: '"' '"' "'" "'";
}
/* Avoid collision of blockquote with floating elements by swapping margin and padding */
blockquote {
overflow: hidden;
margin: 1em 0;
padding: 0 40px;
}
/* Consistent size for <small>, <sub> and <sup> */
small {
font-size: 85%;
}
.mw-body-content sub,
.mw-body-content sup,
span.reference /* for Parsoid */ {
font-size: 80%;
}
/* Same spacing for indented and unindented paragraphs on talk pages */
.ns-talk .mw-body-content dd {
margin-top: 0.4em;
margin-bottom: 0.4em;
}
/* Main page fixes */
#interwiki-completelist {
font-weight: bold;
}
/* Reduce page jumps by hiding collapsed/dismissed content */
.client-js .mw-special-Watchlist #watchlist-message,
.client-js .collapsible:not( .mw-made-collapsible).collapsed > tbody > tr:not(:first-child),
/* Hide charinsert base for those not using the gadget */
#editpage-specialchars {
display: none;
}
/* Adds padding above Watchlist announcements where new recentchanges/watchlist filters are enabled */
.mw-rcfilters-enabled .mw-specialpage-summary {
margin-top: 1em;
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
background-color: rgba(0, 127, 255, 0.133);
}
/* Styling for citations. Breaks long urls, etc., rather than overflowing box */
.citation {
word-wrap: break-word;
}
/* Make the list of references smaller
* Keep in sync with Template:Refbegin/styles.css
* And Template:Reflist/styles.css
*/
ol.references {
font-size: 90%;
margin-bottom: 0.5em;
}
/* Style for horizontal lists (separator following item).
@source mediawiki.org/wiki/Snippets/Horizontal_lists
@revision 8 (2016-05-21)
@author [[User:Edokter]]
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
margin: 0; /* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again */
display: inline;
}
/* Display nested lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* Generate interpuncts */
.hlist dt:after {
content: ": ";
}
/**
* Note hlist style usage differs in Minerva and is defined in core as well!
* Please check Minerva desktop (and Minerva.css) when changing
* See https://phabricator.wikimedia.org/T213239
*/
.hlist dd:after,
.hlist li:after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child:before,
.hlist dd dt:first-child:before,
.hlist dd li:first-child:before,
.hlist dt dd:first-child:before,
.hlist dt dt:first-child:before,
.hlist dt li:first-child:before,
.hlist li dd:first-child:before,
.hlist li dt:first-child:before,
.hlist li li:first-child:before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child:after,
.hlist dd dt:last-child:after,
.hlist dd li:last-child:after,
.hlist dt dd:last-child:after,
.hlist dt dt:last-child:after,
.hlist dt li:last-child:after,
.hlist li dd:last-child:after,
.hlist li dt:last-child:after,
.hlist li li:last-child:after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li:before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
}
/* Unbulleted lists */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none none;
margin: 0;
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
/* Styling for JQuery makeCollapsible, matching that of collapseButton */
.mw-parser-output .mw-collapsible-toggle {
font-weight: normal;
/* @noflip */
text-align: right;
padding-right: 0.2em;
padding-left: 0.2em;
}
.mw-collapsible-leftside-toggle .mw-collapsible-toggle {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
}
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
/* Normal font styling for wikitable row headers with scope="row" tag */
.wikitable.plainrowheaders th[scope=row] {
font-weight: normal;
/* @noflip */
text-align: left;
}
/* Lists in wikitable data cells are always left-aligned */
.wikitable td ul,
.wikitable td ol,
.wikitable td dl {
/* @noflip */
text-align: left;
}
/* Fix for hieroglyphs specificity issue in infoboxes ([[phab:T43869]]) */
table.mw-hiero-table td {
vertical-align: middle;
}
/* Change the external link icon to an Adobe icon for all PDF files */
.mw-parser-output a[href$=".pdf"].external,
.mw-parser-output a[href*=".pdf?"].external,
.mw-parser-output a[href*=".pdf#"].external,
.mw-parser-output a[href$=".PDF"].external,
.mw-parser-output a[href*=".PDF?"].external,
.mw-parser-output a[href*=".PDF#"].external {
background: url("//upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif") no-repeat right;
/* @noflip */
padding-right: 18px;
}
/* Messagebox templates */
.messagebox {
border: 1px solid #a2a9b1;
background-color: #f8f9fa;
width: 80%;
margin: 0 auto 1em auto;
padding: .2em;
}
.messagebox.cleanup {
border: 1px solid #9f9fff;
background-color: #efefff;
text-align: center;
}
.messagebox.standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
margin: 4px auto;
}
/* For old WikiProject banners inside banner shells. */
.mbox-inside .standard-talk {
border: 1px solid #c0c090;
background-color: #f8eaba;
width: 100%;
margin: 2px 0;
padding: 2px;
}
.messagebox.small {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
}
.messagebox.small-talk {
width: 238px;
font-size: 85%;
/* @noflip */
float: right;
clear: both;
/* @noflip */
margin: 0 0 1em 1em;
line-height: 1.25em;
background-color: #f8eaba;
}
/* Cell sizes for ambox/tmbox/imbox/cmbox/ombox/fmbox/dmbox message boxes */
th.mbox-text, td.mbox-text { /* The message body cell(s) */
border: none;
/* @noflip */
padding: 0.25em 0.9em; /* 0.9em left/right */
width: 100%; /* Make all mboxes the same width regardless of text length */
}
td.mbox-image { /* The left image cell */
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em; /* 0.9em left, 0px right */
text-align: center;
}
td.mbox-imageright { /* The right image cell */
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0; /* 0px left, 0.9em right */
text-align: center;
}
td.mbox-empty-cell { /* An empty narrow cell */
border: none;
padding: 0;
width: 1px;
}
/* Article message box styles */
table.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
/* Single border between stacked boxes. */
table.ambox + table.ambox,
table.ambox + .mw-empty-elt + table.ambox {
margin-top: -1px;
}
.ambox th.mbox-text,
.ambox td.mbox-text { /* The message body cell(s) */
padding: 0.25em 0.5em; /* 0.5em left/right */
}
.ambox td.mbox-image { /* The left image cell */
/* @noflip */
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
}
.ambox td.mbox-imageright { /* The right image cell */
/* @noflip */
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
}
table.ambox-notice {
/* @noflip */
border-left: 10px solid #36c; /* Blue */
}
table.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
table.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
table.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
table.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
table.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
/* Image message box styles */
table.imbox {
margin: 4px 10%;
border-collapse: collapse;
border: 3px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
.imbox .mbox-text .imbox { /* For imboxes inside imbox-text cells. */
margin: 0 -0.5em; /* 0.9 - 0.5 = 0.4em left/right. */
display: block; /* Fix for webkit to force 100% width. */
}
.mbox-inside .imbox { /* For imboxes inside other templates. */
margin: 4px;
}
table.imbox-notice {
border: 3px solid #36c; /* Blue */
}
table.imbox-speedy {
border: 3px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.imbox-delete {
border: 3px solid #b32424; /* Red */
}
table.imbox-content {
border: 3px solid #f28500; /* Orange */
}
table.imbox-style {
border: 3px solid #fc3; /* Yellow */
}
table.imbox-move {
border: 3px solid #9932cc; /* Purple */
}
table.imbox-protection {
border: 3px solid #a2a9b1; /* Gray-gold */
}
table.imbox-license {
border: 3px solid #88a; /* Dark gray */
background-color: #f7f8ff; /* Light gray */
}
table.imbox-featured {
border: 3px solid #cba135; /* Brown-gold */
}
/* Category message box styles */
table.cmbox {
margin: 3px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1;
background-color: #dfe8ff; /* Default "notice" blue */
box-sizing: border-box;
}
table.cmbox-notice {
background-color: #d8e8ff; /* Blue */
}
table.cmbox-speedy {
margin-top: 4px;
margin-bottom: 4px;
border: 4px solid #b32424; /* Red */
background-color: #ffdbdb; /* Pink */
}
table.cmbox-delete {
background-color: #ffdbdb; /* Pink */
}
table.cmbox-content {
background-color: #ffe7ce; /* Orange */
}
table.cmbox-style {
background-color: #fff9db; /* Yellow */
}
table.cmbox-move {
background-color: #e4d8ff; /* Purple */
}
table.cmbox-protection {
background-color: #efefe1; /* Gray-gold */
}
/* Other pages message box styles */
table.ombox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
table.ombox-notice {
border: 1px solid #a2a9b1; /* Gray */
}
table.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.ombox-delete {
border: 2px solid #b32424; /* Red */
}
table.ombox-content {
border: 1px solid #f28500; /* Orange */
}
table.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
table.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
table.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
/* Talk page message box styles */
table.tmbox {
margin: 4px 10%;
border-collapse: collapse;
border: 1px solid #c0c090; /* Default "notice" gray-brown */
background-color: #f8eaba;
min-width: 80%;
box-sizing: border-box;
}
.tmbox.mbox-small {
min-width: 0; /* reset the min-width of tmbox above */
}
.mediawiki .mbox-inside .tmbox { /* For tmboxes inside other templates. The "mediawiki" class ensures that */
margin: 2px 0; /* this declaration overrides other styles (including mbox-small above) */
width: 100%; /* For Safari and Opera */
}
.mbox-inside .tmbox.mbox-small { /* "small" tmboxes should not be small when */
line-height: 1.5em; /* also "nested", so reset styles that are */
font-size: 100%; /* set in "mbox-small" above. */
}
table.tmbox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
table.tmbox-delete {
border: 2px solid #b32424; /* Red */
}
table.tmbox-content {
border: 2px solid #f28500; /* Orange */
}
table.tmbox-style {
border: 2px solid #fc3; /* Yellow */
}
table.tmbox-move {
border: 2px solid #9932cc; /* Purple */
}
table.tmbox-protection,
table.tmbox-notice {
border: 1px solid #c0c090; /* Gray-brown */
}
/* Footer and header message box styles */
table.fmbox {
clear: both;
margin: 0.2em 0;
width: 100%;
border: 1px solid #a2a9b1;
background-color: #f8f9fa; /* Default "system" gray */
box-sizing: border-box;
}
table.fmbox-system {
background-color: #f8f9fa;
}
table.fmbox-warning {
border: 1px solid #bb7070; /* Dark pink */
background-color: #ffdbdb; /* Pink */
}
table.fmbox-editnotice {
background-color: transparent;
}
/* Div based "warning" style fmbox messages. */
div.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon,
div.titleblacklist-warning {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* Use default color for partial block fmbox banner per [[Special:PermaLink/1028105567#pblock-style]] */
.mw-contributions-blocked-notice-partial .mw-warning-with-logexcerpt {
border-color: #fc3;
background-color: #fef6e7;
}
/* These mbox-small classes must be placed after all other
ambox/tmbox/ombox etc classes. "html body.mediawiki" is so
they override "table.ambox + table.ambox" above. */
html body.mediawiki .mbox-small { /* For the "small=yes" option. */
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
box-sizing: border-box;
width: 238px;
font-size: 88%;
line-height: 1.25em;
}
html body.mediawiki .mbox-small-left { /* For the "small=left" option. */
/* @noflip */
margin: 4px 1em 4px 0;
box-sizing: border-box;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
/* Style for compact ambox */
/* Hide the images */
.compact-ambox table .mbox-image,
.compact-ambox table .mbox-imageright,
.compact-ambox table .mbox-empty-cell {
display: none;
}
/* Remove borders, backgrounds, padding, etc. */
.compact-ambox table.ambox {
border: none;
border-collapse: collapse;
background-color: transparent;
margin: 0 0 0 1.6em !important;
padding: 0 !important;
width: auto;
display: block;
}
body.mediawiki .compact-ambox table.mbox-small-left {
font-size: 100%;
width: auto;
margin: 0;
}
/* Style the text cell as a list item and remove its padding */
.compact-ambox table .mbox-text {
padding: 0 !important;
margin: 0 !important;
}
.compact-ambox table .mbox-text-span {
display: list-item;
line-height: 1.5em;
list-style-type: square;
list-style-image: url(/w/skins/MonoBook/resources/images/bullet.svg);
}
/* Allow for hiding text in compact form */
.compact-ambox .hide-when-compact {
display: none;
}
/* Remove underlines from certain links */
.nounderlines a,
.IPA a:link,
.IPA a:visited {
text-decoration: none !important;
}
/* Prevent line breaks in silly places where desired (nowrap)
and links when we don't want them to (nowraplinks a) */
.nowrap,
.nowraplinks a {
white-space: nowrap;
}
/* But allow wrapping where desired: */
.wrap,
.wraplinks a {
white-space: normal;
}
/* Increase the height of the image upload box */
#wpUploadDescription {
height: 13em;
}
/* Minimum thumb width */
.thumbinner {
min-width: 100px;
}
/* Prevent floating boxes from overlapping any category listings,
file histories, edit previews, and edit [Show changes] views. */
#mw-subcategories,
#mw-pages,
#mw-category-media,
#filehistory,
#wikiPreview,
#wikiDiff {
clear: both;
}
/* Selectively hide headers in WikiProject banners */
/* TemplateStyles */
.wpb .wpb-header {
display: none;
}
.wpbs-inner .wpb .wpb-header {
display: table-row;
}
.wpbs-inner .wpb-outside {
display: none; /* hide things that should only display outside shells */
}
/* Styling for Abuse Filter tags */
.mw-tag-markers {
font-style: italic;
font-size: 90%;
}
/* Hide stuff meant for accounts with special permissions. Made visible again in
[[MediaWiki:Group-checkuser.css]], [[MediaWiki:Group-sysop.css]], [[MediaWiki:Group-abusefilter.css]],
[[MediaWiki:Group-abusefilter-helper.css]], [[MediaWiki:Group-patroller.css]],
[[MediaWiki:Group-templateeditor.css]], [[MediaWiki:Group-extendedmover.css]],
[[MediaWiki:Group-extendedconfirmed.css]], and [[Mediawiki:Group-autoconfirmed.css]]. */
.checkuser-show,
.sysop-show,
.abusefilter-show,
.abusefilter-helper-show,
.patroller-show,
.templateeditor-show,
.extendedmover-show,
.extendedconfirmed-show,
.autoconfirmed-show,
.user-show {
display: none;
}
/* Hide the redlink generated by {{Editnotice}},
this overrides the ".sysop-show { display: none; }" above that applies
to the same link as well. See [[phab:T45013]]
Hide the images in editnotices to keep them readable in VE view.
Long term, editnotices should become a core feature so that they can be designed responsive. */
.ve-ui-mwNoticesPopupTool-item .editnotice-redlink,
.ve-ui-mwNoticesPopupTool-item .mbox-image,
.ve-ui-mwNoticesPopupTool-item .mbox-imageright {
display: none !important;
}
/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors > li {
list-style: none none;
}
ul.permissions-errors {
margin: 0;
}
/* texhtml class for inline math (based on generic times-serif class) */
span.texhtml {
font-family: "Nimbus Roman No9 L", "Times New Roman", Times, serif;
font-size: 118%;
line-height: 1;
white-space: nowrap;
/* Force tabular and lining display for texhtml */
-moz-font-feature-settings: "lnum", "tnum", "kern" 0;
-webkit-font-feature-settings: "lnum", "tnum", "kern" 0;
font-feature-settings: "lnum", "tnum", "kern" 0;
font-variant-numeric: lining-nums tabular-nums;
font-kerning: none;
}
span.texhtml span.texhtml {
font-size: 100%;
}
span.mwe-math-mathml-inline {
font-size: 118%;
}
/* Make <math display="block"> be left aligned with one space indent for
* compatibility with style conventions
*/
.mwe-math-fallback-image-display,
.mwe-math-mathml-display {
margin-left: 1.6em !important;
margin-top: 0.6em;
margin-bottom: 0.6em;
}
.mwe-math-mathml-display math {
display: inline;
}
/* Work-around for [[phab:T25965]] / [[phab:T100106]] (Kaltura advertisement) */
.k-player .k-attribution {
visibility: hidden;
}
/* Move 'play' button of video player to bottom left corner */
.PopUpMediaTransform a .play-btn-large {
margin: 0;
top: auto;
right: auto;
bottom: 0;
left: 0;
}
@media screen {
/* Gallery styles background changes are restricted to screen view.
In printing we should avoid applying backgrounds. */
/* The backgrounds for galleries. */
#content .gallerybox div.thumb {
/* Light gray padding */
background-color: #f8f9fa;
}
/* Put a chequered background behind images, only visible if they have transparency.
'.filehistory a img' and '#file img:hover' are handled by MediaWiki core (as of 1.19) */
.gallerybox .thumb img {
background: #fff url(//upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png) repeat;
}
/* But not on articles, user pages, portals or with opt-out. */
.ns-0 .gallerybox .thumb img,
.ns-2 .gallerybox .thumb img,
.ns-100 .gallerybox .thumb img,
.nochecker .gallerybox .thumb img {
background-image: none;
}
/* Display "From Wikipedia, the free encyclopedia" in skins that support it,
do not apply to print mode */
#siteSub {
display: block;
}
}
/* Hide FlaggedRevs notice UI when there are no pending changes */
.flaggedrevs_draft_synced,
.flaggedrevs_stable_synced,
/* "Temporary" to remove links in sidebar T255381 */
#t-upload,
/* Hide broken download box on Special:Book pending T285400 */
.mw-special-Book #coll-downloadbox {
display: none;
}
b64d2ecd3f1f4e45d6b23a5c54028445b0d2a112
Template:Infobox
10
116
429
272
2022-01-17T04:02:19Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Infobox]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:Clear
10
118
431
276
2022-01-17T04:02:19Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Clear]]: Import Miraheze infobox template
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Distinguish
10
119
433
278
2022-01-17T04:02:19Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Distinguish]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Template:Documentation
10
35
435
286
2022-01-17T04:02:20Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Documentation]]: Import Miraheze infobox template
wikitext
text/x-wiki
<!-- {{#invoke:Autotranslate|autotranslate}} is used to avoid "Warning: This page calls Template:Autotranslate which causes a template loop (an infinite recursive call). "-->
<onlyinclude>{{#invoke:Autotranslate|autotranslate
| base = Template:Documentation/i18n
|lang = {{{lang|{{int:Lang}} }}}
|1 = {{#if:{{{1|}}}
|{{{1}}}
|{{#ifexist:{{SUBJECTPAGENAME}}/doc
|{{SUBJECTPAGENAME}}/doc
|{{#ifexist:{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{#titleparts:{{SUBJECTPAGENAME}}|-1}}/doc
|{{SUBJECTPAGENAME}}/doc
}}
}}
}}
|2 = {{{heading|{{{2|}}} }}}
|content = {{{content|}}}
}}</onlyinclude>
7ad33c9fa0ba8f527d5f6f881ab8ab02837d7e17
Template:Documentation subpage
10
39
437
288
2022-01-17T04:02:20Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Documentation_subpage]]: Import Miraheze infobox template
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{SUBPAGENAME}}|{{#ifeq:{{{1|}}}|override|{{SUBPAGENAME}}|doc}}|</includeonly><!-- show on doc pages only
-->{{#invoke:Autotranslate | autotranslate
|base = Documentation subpage
|lang = {{{lang|}}}
|page = {{#if:{{{page|}}}|{{{page|}}}|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}
}}<!--
--><includeonly>{{{category|[[Category:{{#switch:{{SUBJECTSPACE}}
| Template = Template
| Module = Module
| User = User
| #default = Template
}} documentation|{{PAGENAME}}]]__EXPECTED_UNCONNECTED_PAGE__}}}</includeonly><!--
--><includeonly>}}</includeonly><!-- show on doc pages only
--><noinclude>{{documentation}}</noinclude>
783c674f03e3009e9b9ddc1cfd632a593534f7c6
Template:En-WP attribution notice
10
191
439
438
2022-01-17T04:02:21Z
TheSink
2
1 revision imported from [[:templatewiki:Template:En-WP_attribution_notice]]: Import Miraheze infobox template
wikitext
text/x-wiki
<includeonly>{| style="border: 1px solid #e0e0e0; background-color: #f8f8f8; color:black; margin: 5px auto; width: 60%;"
|-
| style="padding: 3px 10px;" | [[File:Wikipedia-logo-v2.svg|30px|Wikipedia logo]]
| style="font-size: 90%; padding: 3px;" | This {{Pagetype}} uses material from the Wikipedia {{Pagetype|page={{{1|{{FULLPAGENAME}}}}}}} [[w:en:{{{1|{{FULLPAGENAME}}}}}|{{{1|{{FULLPAGENAME}}}}}]], which is released under the [[w:en:Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License|Creative Commons Attribution-ShareAlike 3.0 Unported License]] ([https://en.wikipedia.org/w/index.php?title={{urlencode:{{{1|{{FULLPAGENAME}}}}}}}&action=history view authors]).
|}
[[Category:{{Pagetype|category=Categorie}}s from English Wikipedia]]</includeonly>
<noinclude>
{{documentation}}
[[Category:Attribution templates]]
{{En-WP attribution notice|Template:En-WP attribution notice}}
</noinclude>
2f8572b5c25751c527d33ac2122cfc3cdcc7d622
Template:Infobox/doc
10
124
441
292
2022-01-17T04:02:23Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Infobox/doc]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old ||{{High-use|3408796|all-pages=yes}}{{Lua|Module:Infobox}}}}</includeonly>
{{Parameter names example
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
|label2={{{label1}}} |data2={{{data1}}}
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
|label6={{{label2}}} |data6={{{data2}}}
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
|below
}}
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
{{tlf|Infobox}} is a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|Infobox building}}).
For <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, template code then looks like this, simplified:
<pre>
{{Infobox
| name = {{{name|{{PAGENAME}}}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| label1 = Former names
| data1 = {{{former_names|}}}
| header2 = General information
| label3 = Status
| data3 = {{{status|}}}
... <!-- etc. -->
}}
</pre>
== Optional control parameters ==
; name : If this parameter is present, "view/talk/edit" links will be added to the bottom of the infobox pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however, this is rarely what you want because it will send users clicking these links in an infobox to the template code rather than the data in the infobox they probably want to change.
; child : See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
; subbox : See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
; autoheaders: If this is set to any non-blank value, headers which are not followed by data fields are suppressed. See the "[[#Hiding headers when all its data fields are empty|hiding headers when all its data fields are empty]]" section for more details.
== Content parameters ==
=== Title ===
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts it as a caption on top of the table. You can use them both together, or just one or the other, or neither (though this is not recommended):
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
; above : Text to put within the uppermost cell of the table.
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
Examples:
{{Infobox
| name = Infobox/doc
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
| subheader = Subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
{{Infobox
| name = Infobox/doc
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
| subheader = Subheader of the infobox
| subheader2 = Second subheader of the infobox
| header = (the rest of the infobox goes here)
}}
</pre>{{clear}}
=== Illustration images ===
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
; caption(n) : Text to put underneath the images.
=== Main data ===
; header(n) : Text to use as a header in row n.
; label(n) : Text to use as a label in row n.
; data(n) : Text to display as data in row n.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) to be ignored; the absence of a {{para|data''(n)''}} will cause the corresponding {{para|label''(n)''}} to be ignored. Valid combinations for any single row are:
* {{para|class''(n)''}} {{para|header''(n)''}}
* {{para|rowclass''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
* {{para|rowclass''(n)''}} {{para|label''(n)''}} {{para|class''(n)''}} {{para|data''(n)''}}
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
==== Number ranges ====
To allow flexibility when the layout of an infobox is changed, it may be helpful when developing an infobox to use non-contiguous numbers for header and label/data rows. Parameters for new rows can then be inserted in future without having to renumber existing parameters. For example:
<pre style="overflow:auto">
| header3 = Section 1
| label5 = Label A
| data5 = Data A
| label7 = Label C
| data7 = Data C
| header10 = Section 2
| label12 = Label D
| data12 = Data D
</pre>{{clear}}
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
==== Making data fields optional ====
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
<pre style="overflow:auto">
| label5 = Population
| data5 = {{{population|}}}
</pre>{{clear}}
This way if an article doesn't define the population parameter in its infobox the row won't be displayed.
For more complex fields with pre-formatted contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'":
<pre style="overflow:auto">
| label6 = Mass
| data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
</pre>{{clear}}
For more on #if, see [[meta:ParserFunctions##if:|here]].
==== Hiding headers when all its data fields are empty ====
You can also make headers automatically hide when their section is empty (has no data-row showing).
Consider this situation:
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<pre style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</pre>{{clear}}
If you want hide the header when no {{para|data''N''}} values are present, use '''{{para|autoheaders|y}}''':
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = Header5 with data below
| label6 = label6 text | data6 = Some value
}}
</syntaxhighlight>{{clear}}
So, header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next visible content.
Note: if the data has empty css elements, like {{para|data|2=<span style="background:yellow;"></span>}}, this will be treated as non-empty (having data).
If {{para|autoheaders|y}} but there are items that you ''do not'' want to trigger a header, place {{para|headerX|_BLANK_}}. This will serve as an empty header and separate it from the subsequent items.
{{Infobox
| title = Example: blank header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
<syntaxhighlight lang="moin" style="overflow:auto">
{{Infobox
| title = Example: header with & without data
| autoheaders = y
| headerstyle = background:lightgrey
| header1 = Header1 with empty section
| label2 = label2 text | data2 =
| label3 = label3 text | data3 =
| label4 = label4 text | data4 =
| header5 = _BLANK_
| label6 = label6 text | data6 = Some value, but does not trigger header1 or show header5
}}
</syntaxhighlight>{{clear}}
=== Footer ===
; below : Text to put in the bottom cell. The bottom cell is intended for footnotes, see-also, and other such information.
== Presentation parameters ==
=== Italic titles ===
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
=== CSS styling ===
{{div col}}
; bodystyle : Applies to the infobox table as a whole
; titlestyle : Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox.
; abovestyle : Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle.
; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle : Applies to the text of the image caption.
; rowstyle(n) : This parameter is inserted into the <code>style</code> attribute for the specified row.
; headerstyle : Applies to all header cells
; subheaderstyle : Applies to all subheader cells
; labelstyle : Applies to all label cells
; datastyle : Applies to all data cells
; belowstyle : Applies only to the below cell
{{div col end}}
=== HTML classes and microformats ===
{{div col}}
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
<!-- currently not implemented in Lua module
; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on.
-->
; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell.
; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on.
; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''.
; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on.
; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''.
; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells.
; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect.
<!-- currently not implemented in Lua module
; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on.
-->
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
{{div col end}}
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others being used for microformats.
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
<pre style="overflow:auto">
| bodyclass = vcard
</pre>{{clear}}
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
<pre style="overflow:auto">
| class1 = fn
| class2 = org
| class3 = tel
</pre>{{clear}}
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Infobox
|name = Infobox/doc
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
<syntaxhighlight lang="Sass" style="overflow:auto" highlight="15">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
|imagestyle =
|captionstyle =
| image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
|belowstyle = background:#ddf;
|below = Below text
}}
</syntaxhighlight>{{clear}}
For this example, the {{para|bodystyle}} and {{para|labelstyle}} parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
<syntaxhighlight lang="sass" highlight="3,9" style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
|titlestyle =
|title = Test Infobox
|headerstyle =
|labelstyle = width:33%
|datastyle =
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|belowstyle =
|below = Below text
}}
</syntaxhighlight>{{clear}}
== Embedding ==
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| data1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{Infobox | decat = yes | child = yes
|title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = {{Infobox | decat = yes | child = yes
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{Infobox | decat = yes | child = yes
| title = Second subsection
| label1= Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
or,
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
<pre style="overflow:auto">
{{Infobox
| title = Top level title
| header1 = First subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{Infobox | decat = yes | child = yes
| label1 = Label 2.1
| data1 = Data 2.1
}}
| belowstyle =
| below = Below text
}}
</pre>{{clear}}
Note that omitting the {{para|title}} parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation. The garbage output can be suppressed using {{para|rowstyleN|display: none}}, replacing N with the data/header number.
[[Wikipedia:WikiProject Infoboxes/embed]] includes some links to Wikipedia articles which include infoboxes embedded within other infoboxes.
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Infobox
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| label5 = Label 5 | data5 = Data 5
| header6 = Main 6
}}
</syntaxhighlight>{{clear}}
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<syntaxhighlight lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</syntaxhighlight>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
== Controlling line-breaking in embedded bulletless lists ==
Template {{tlx|nbsp}} may be used with {{tlx|wbr}} and {{tlx|nowrap}} to control line-breaking in bulletless lists embedded in infoboxes (e.g. cast list in {{tlx|Infobox film}}), to prevent wrapped long entries from being confused with multiple entries. See [[Template:Wbr/doc#Controlling line-breaking in infoboxes]] for details.
== Full blank syntax ==
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
<pre style="overflow:auto">
{{Infobox
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
| subbox = {{{subbox|}}}
| italic title = {{{italic title|no}}}
| templatestyles =
| child templatestyles =
| grandchild templatestyles =
| bodystyle =
| titlestyle =
| abovestyle =
| subheaderstyle =
| title =
| above =
| subheader =
| imagestyle =
| captionstyle =
| image =
| caption =
| image2 =
| caption2 =
| headerstyle =
| labelstyle =
| datastyle =
| header1 =
| label1 =
| data1 =
| header2 =
| label2 =
| data2 =
| header3 =
| label3 =
| data3 =
| header4 =
| label4 =
| data4 =
| header5 =
| label5 =
| data5 =
| header6 =
| label6 =
| data6 =
| header7 =
| label7 =
| data7 =
| header8 =
| label8 =
| data8 =
| header9 =
| label9 =
| data9 =
| header10 =
| label10 =
| data10 =
| header11 =
| label11 =
| data11 =
| header12 =
| label12 =
| data12 =
| header13 =
| label13 =
| data13 =
| header14 =
| label14 =
| data14 =
| header15 =
| label15 =
| data15 =
| header16 =
| label16 =
| data16 =
| header17 =
| label17 =
| data17 =
| header18 =
| label18 =
| data18 =
| header19 =
| label19 =
| data19 =
| header20 =
| label20 =
| data20 =
| belowstyle =
| below =
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
== Porting to other MediaWikis ==
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.",
"format": "{{_\n| ________________ = _\n}}\n",
"params": {
"title": {
"label": "Title",
"description": "Title displayed above the infobox",
"type": "string",
"suggested": true
}
},
"paramOrder": [
"title"
]
}
</templatedata>
==Tracking categories==
* {{Category link with count|Articles with missing Wikidata information}}
* {{Category link with count|Articles using infobox templates with no data rows}}
* {{Category link with count|Pages using embedded infobox templates with the title parameter}}
==See also==
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Module:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
<includeonly>{{Sandbox other||
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
[[Category:Templates that add a tracking category]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
4916f93a28dc7393586e49c6c637705d88b5e3e9
Template:Lua
10
125
443
294
2022-01-17T04:02:23Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Lua]]: Import Miraheze infobox template
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Nobold
10
126
445
298
2022-01-17T04:02:23Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Nobold]]: Import Miraheze infobox template
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Pagetype
10
192
447
446
2022-01-17T04:02:24Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Pagetype]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Pagetype}}
</noinclude>
b6d5e4de8a716664120e2fd68dd5932b85777262
Template:Para
10
128
449
302
2022-01-17T04:02:24Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Para]]: Import Miraheze infobox template
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
Template:Parameter names example
10
129
451
304
2022-01-17T04:02:25Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Parameter_names_example]]: Import Miraheze infobox template
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
Template:Sidebar
10
131
453
308
2022-01-17T04:02:25Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Sidebar]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{#invoke:Sidebar|sidebar}}<noinclude>
{{documentation}}</noinclude>
ab2498000a99daf324f656b0badd187b4a3e2b42
Template:Template link
10
133
455
312
2022-01-17T04:02:25Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Template_link]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Tl
10
54
457
322
2022-01-17T04:02:26Z
TheSink
2
1 revision imported from [[:templatewiki:Template:Tl]]: Import Miraheze infobox template
wikitext
text/x-wiki
<noinclude>{{protected template}}
</noinclude>{{T/main|{{{1|}}}
|{{{2|}}}
|{{{3|{{{lang|}}}}}}
|{{{4|}}}
|{{{5|}}}
|incl={{{incl|{{{i|3}}}}}}
|code={{{code|}}}
|link={{{link|}}}
|case={{{case|}}}
|i18n={{{i18n|}}}
|parm={{{parm|}}}
|full={{{full|}}}
|style={{{style|}}}
}}<noinclude>
{{documentation|Template:T/doc}}
</noinclude>
06c675ce6e24c57cb8f52ad7ad989aeda3525f57
Help:Infobox/user style
12
142
459
332
2022-01-17T04:02:27Z
TheSink
2
1 revision imported from [[:templatewiki:Help:Infobox/user_style]]: Import Miraheze infobox template
wikitext
text/x-wiki
{{{heading|
==Infoboxes and user style ==
}}}
Users can have [[WP:User style|user CSS]] that hides<!--, moves, or makes collapsible--> any infoboxes in their own browsers.
To hide all infoboxes, add the following to [[Special:MyPage/common.css]] (for all [[WP:Skin|skins]], or [[Special:MyPage/skin.css]] for just the current skin), on a line by itself:
<syntaxhighlight lang="css">div.mw-parser-output .infobox { display: none; }</syntaxhighlight>
Alternatively, you can add the following code to [[Special:MyPage/common.js|your common.js]] or into a browser user script that is executed by an extension like [[Greasemonkey]]:
<syntaxhighlight lang="js">$('.infobox').hide();</syntaxhighlight>
Be aware that although{{#if:{{{guideline|}}}||, per [[WP:Manual of Style/Infoboxes]],}} all information in an infobox ideally should also be found in the main body of an article, there isn't perfect compliance with this guideline. For example, the full taxonomic hierarchy in {{tlx|Taxobox}}, and the OMIM and other medical database codes of {{tlx|Infobox disease}} are often not found in the main article content. The infobox is also often the location of the most significant, even only, image in an article.<!--
Needs Special:Mypage/common.js options for:
* Making infoboxes collapsible
** Making them auto-collapsed
* Moving infoboxes to bottom of page
--><noinclude>
{{Documentation|content=
This documentation snippet is transcluded at [[Help:Infobox]], [[Template:Infobox/doc]], [[WP:Customisation#Hiding specific messages]], [[Help:User style]], [[WP:Manual of Style/Infoboxes]], and other places where this information is relevant.
As a template, this snippet takes a {{para|heading}} parameter to replace the level-2 <code>==Infoboxes and user style==</code> section heading code, as needed. E.g., for a <code>=== ... ===</code> level-3 heading: <code><nowiki>heading={{=}}{{=}}{{=}}Infoboxes and user style{{=}}{{=}}{{=}}</nowiki></code>
}}
</noinclude>
6da0d499b1fda33a6ba13b40e6605692fc3bb489
Module:Arguments
828
83
461
334
2022-01-17T04:02:27Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Arguments]]: Import Miraheze infobox template
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Distinguish
828
144
463
338
2022-01-17T04:02:27Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Distinguish]]: Import Miraheze infobox template
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Module:Documentation
828
145
465
340
2022-01-17T04:02:27Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Documentation]]: Import Miraheze infobox template
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return mw.ustring.format('[[%s|%s]]', page, display)
else
return mw.ustring.format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return '<span class="' .. message('toolbar-class') .. '">('
.. table.concat(ret, ' | ') .. ')</span>'
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
local data = {}
data.title = title
data.docTitle = docTitle
-- View, display, edit, and purge links if /doc exists.
data.viewLinkDisplay = message('view-link-display')
data.editLinkDisplay = message('edit-link-display')
data.historyLinkDisplay = message('history-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
data.preload = preload
data.createLinkDisplay = message('create-link-display')
return data
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '[') -- Replace square brackets with HTML entities.
s = s:gsub('%]', ']')
return s
end
local ret
local docTitle = data.docTitle
local title = data.title
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s] [%s]'
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink, purgeLink)
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editUrl = docTitle:fullUrl{action = 'edit'}
local editDisplay = message('edit-link-display')
local editLink = makeUrlLink(editUrl, editDisplay)
local historyUrl = docTitle:fullUrl{action = 'history'}
local historyDisplay = message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
75db229661bf7a537917c514074614e59a70fd0a
Module:Documentation/config
828
146
467
342
2022-01-17T04:02:28Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Documentation/config]]: Import Miraheze infobox template
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
a7cdf1cda3185137d4cb51b2839cd5e5c9b91d18
Module:Documentation/styles.css
828
147
469
344
2022-01-17T04:02:28Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Documentation/styles.css]]: Import Miraheze infobox template
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Module:Hatnote
828
152
471
354
2022-01-17T04:02:28Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Hatnote]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(inline == 1 and 'hatnote-inline' or 'hatnote')
:addClass('navigation-not-searchable')
:addClass(extraclasses)
:addClass(options.selfref and 'selfref')
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
44d8f670e8ea9780e48425da6da49c8a5ba1fc20
Module:Hatnote list
828
154
473
358
2022-01-17T04:02:29Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Hatnote_list]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation
local function punctuationCollapse (text)
local replacements = {
["%.%.$"] = ".",
["%?%.$"] = "?",
["%!%.$"] = "!",
["%.%]%]%.$"] = ".]]",
["%?%]%]%.$"] = "?]]",
["%!%]%]%.$"] = "!]]"
}
for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
return text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
d0828422b1aa0d0d0092d699d059c9e882260398
Module:Infobox
828
156
475
361
2022-01-17T04:02:29Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Infobox]]: Import Miraheze infobox template
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles, -- see function description
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
05a758c4532f643205b2300a5935f5d4ef3fc721
Module:List
828
168
477
374
2022-01-17T04:02:29Z
TheSink
2
1 revision imported from [[:templatewiki:Module:List]]: Import Miraheze infobox template
Scribunto
text/plain
-- This module outputs different kinds of lists. At the moment, bulleted,
-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes
data.classes = {}
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist hlist-separated')
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for i, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for i, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
0d6c114450d0f5b3c1d2171ebeb41ae74f203f88
Module:Lua banner
828
166
479
372
2022-01-17T04:02:29Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Lua_banner]]: Import Miraheze infobox template
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation'] = 'Templates based on the Citation/CS1 Lua module'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
6e3bedcc849ff22d4f702708965c39b97d7e8585
Module:Message box
828
165
481
371
2022-01-17T04:02:30Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Message_box]]: Import Miraheze infobox template
Scribunto
text/plain
-- This is a meta-module for producing message box templates, including
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
-- Load necessary modules.
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')
-- Get a language object for formatDate and ucfirst.
local lang = mw.language.getContentLanguage()
-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'>''(<span class='date'>%s</span>)''</span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:0;width:1px'
end
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
:cssText(self.imageEmptyCellStyle or nil)
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):css('width', '52px')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:css('text-align', 'center')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
b1fd4c365d29a34bbcf3aef2adec6701ed0efe45
Module:Message box/configuration
828
169
483
375
2022-01-17T04:02:30Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Message_box/configuration]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
imageEmptyCellStyle = true,
templateCategory = 'Talk message boxes'
}
}
ef8171b8278c52d9c20a4149614d97cd948670c2
Module:Namespace detect
828
193
485
484
2022-01-17T04:02:30Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Namespace_detect]]: Import Miraheze infobox template
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Module:Namespace detect/config
828
194
487
486
2022-01-17T04:02:31Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Namespace_detect/config]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
195
489
488
2022-01-17T04:02:31Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Namespace_detect/data]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Navbar
828
161
491
367
2022-01-17T04:02:31Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Navbar]]: Import Miraheze infobox template
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
a5c8d3a8f8beb18984ea7f145ddbdf88a065d23e
Module:No globals
828
64
493
144
2022-01-17T04:02:31Z
TheSink
2
1 revision imported from [[:templatewiki:Module:No_globals]]: Import Miraheze infobox template
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
Module:Pagetype
828
196
495
494
2022-01-17T04:02:32Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Pagetype]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
if redirect then
return redirect
else
return getNsDetectValue(args)
end
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
4e76ed8318e724693304c0ca2063b36b0890825a
Module:Pagetype/config
828
197
497
496
2022-01-17T04:02:32Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Pagetype/config]]: Import Miraheze infobox template
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['book'] = 'book',
['draft'] = 'draft',
['education program'] = 'education program page',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module',
'book'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'book',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
cbb04dd488cb9335e0f9f749e3d106e6071cfead
Module:Parameter names example
828
167
499
373
2022-01-17T04:02:33Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Parameter_names_example]]: Import Miraheze infobox template
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
targs['nocat'] = 'yes';
targs['categories'] = 'no';
targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
576eb8298850f4e4e62105ac740df295b7b7eb9e
Module:Sidebar
828
170
501
378
2022-01-17T04:02:33Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Sidebar]]: Import Miraheze infobox template
Scribunto
text/plain
--
-- This module implements {{Sidebar}}
--
require('Module:No globals')
local cfg = mw.loadData('Module:Sidebar/configuration')
local p = {}
local getArgs = require('Module:Arguments').getArgs
--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
if title.text:match(pattern) then return '' end
end
for key, _ in pairs(args) do
if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
return cfg.i18n.category.conversion
end
end
end
--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
return '\n' .. s
else
return s
end
end
--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function hasSubgroup(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
else
return false
end
end
--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
if not args then
args = getArgs(frame)
end
local root = mw.html.create()
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
if args.outertitle then
root
:tag('caption')
:addClass(cfg.i18n.class.outer_title)
:addClass(args.outertitleclass)
:cssText(args.outertitlestyle)
:wikitext(args.outertitle)
end
if args.topimage then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.top_image)
:addClass(args.topimageclass)
:cssText(args.topimagestyle)
:wikitext(args.topimage)
if args.topcaption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.top_caption)
:cssText(args.topcaptionstyle)
:wikitext(args.topcaption)
end
end
if args.pretitle then
root
:tag('tr')
:tag('td')
:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
or cfg.i18n.class.pretitle)
:addClass(args.pretitleclass)
:cssText(args.basestyle)
:cssText(args.pretitlestyle)
:wikitext(args.pretitle)
end
else
root
:addClass(cfg.i18n.class.subgroup)
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
if args.title then
if child then
root
:wikitext(args.title)
else
root
:tag('tr')
:tag('th')
:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
or cfg.i18n.class.title)
:addClass(args.titleclass)
:cssText(args.basestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
end
end
if args.image then
local imageCell = root:tag('tr'):tag('td')
imageCell
:addClass(cfg.i18n.class.image)
:addClass(args.imageclass)
:cssText(args.imagestyle)
:wikitext(args.image)
if args.caption then
imageCell
:tag('div')
:addClass(cfg.i18n.class.caption)
:cssText(args.captionstyle)
:wikitext(args.caption)
end
end
if args.above then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.above)
:addClass(args.aboveclass)
:cssText(args.abovestyle)
:newline() -- newline required for bullet-points to work
:wikitext(args.above)
end
local rowNums = {}
for k, v in pairs(args) do
k = '' .. k
local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
if num then table.insert(rowNums, tonumber(num)) end
end
table.sort(rowNums)
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
-- and content3 are specified)
for i = #rowNums, 1, -1 do
if rowNums[i] == rowNums[i - 1] then
table.remove(rowNums, i)
end
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
if heading then
root
:tag('tr')
:tag('th')
:addClass(cfg.i18n.class.heading)
:addClass(args.headingclass)
:addClass(args['heading' .. num .. 'class'])
:cssText(args.basestyle)
:cssText(args.headingstyle)
:cssText(args['heading' .. num .. 'style'])
:newline()
:wikitext(heading)
end
local content = args['content' .. num]
if content then
root
:tag('tr')
:tag('td')
:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup
or cfg.i18n.class.content)
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:newline()
:wikitext(content)
:done()
-- Without a linebreak after the </td>, a nested list like
-- "* {{hlist| ...}}" doesn't parse correctly.
:newline()
end
end
if args.below then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.below)
:addClass(args.belowclass)
:cssText(args.belowstyle)
:newline()
:wikitext(args.below)
end
if not child then
if args.navbar ~= cfg.i18n.navbar_none and args.navbar ~= cfg.i18n.navbar_off and
(args.name or frame:getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
cfg.i18n.title_not_to_add_navbar) then
root
:tag('tr')
:tag('td')
:addClass(cfg.i18n.class.navbar)
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
fontstyle = args.navbarfontstyle
})
end
end
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
}
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles,
tostring(root),
(child and cfg.i18n.category.child or ''),
categorizeTemplatesWithInlineStyles(args)
})
end
local function list_title(args, is_centered_list_titles, num)
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
or cfg.i18n.default_list_title)
local title
if is_centered_list_titles then
-- collapsible can be finicky, so provide some CSS/HTML to support
title = mw.html.create('div')
:addClass(cfg.i18n.class.list_title_centered)
:wikitext(title_text)
else
title = mw.html.create()
:wikitext(title_text)
end
local title_container = mw.html.create('div')
:addClass(cfg.i18n.class.list_title)
-- don't /need/ a listnumtitleclass because you can do
-- .templateclass .listnumclass .sidebar-list-title
:addClass(args.listtitleclass)
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
:done()
return title_container
end
--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
local args = getArgs(frame)
if not args.name and
frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
end
local contentArgs = {}
local is_centered_list_titles
if args['centered list titles'] and args['centered list titles'] ~= '' then
is_centered_list_titles = true
else
is_centered_list_titles = false
end
for k, v in pairs(args) do
local num = string.match(k, '^list(%d+)$')
if num then
local expand = args.expanded and
(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
local row = mw.html.create('div')
row
:addClass(cfg.i18n.class.list)
:addClass('mw-collapsible')
:addClass((not expand) and 'mw-collapsed' or nil)
:addClass(args['list' .. num .. 'class'])
:cssText(args.listframestyle)
:cssText(args['list' .. num .. 'framestyle'])
:node(list_title(args, is_centered_list_titles, num))
:tag('div')
:addClass(cfg.i18n.class.list_content)
:addClass('mw-collapsible-content')
-- don't /need/ a listnumstyleclass because you can do
-- .templatename .listnumclass .sidebar-list
:addClass(args.listclass)
:cssText(args.liststyle)
:cssText(args['list' .. num .. 'style'])
:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))
contentArgs['content' .. num] = tostring(row)
end
end
for k, v in pairs(contentArgs) do
args[k] = v
end
return p.sidebar(frame, args, cfg.i18n.class.collapse)
end
return p
7591145c23ee59ac9381516327bc376f741bbb5f
Module:TableTools
828
67
503
150
2022-01-17T04:02:33Z
TheSink
2
1 revision imported from [[:templatewiki:Module:TableTools]]: Import Miraheze infobox template
Scribunto
text/plain
--[[
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should --
-- not be called directly from #invoke. --
------------------------------------------------------------------------------------
--]]
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
if type(v) == 'number' and tostring(v) == '-nan' then
return true
else
return false
end
end
--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
checkType('removeDuplicates', 1, t, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for i, v in ipairs(t) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k, v in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
return s
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for k in pairs(t) do
i = i + 1
end
return i
end
return p
ab9df0eb210b08945b9eed86435858f6e931a79a
Module:Yesno
828
159
505
365
2022-01-17T04:02:34Z
TheSink
2
1 revision imported from [[:templatewiki:Module:Yesno]]: Import Miraheze infobox template
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Main Page
0
1
506
414
2022-01-17T04:19:21Z
TheSink
2
Edit main page wiki introduction
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 14.1'''. Development of '''Beta 15.0''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
b8825dc14849cebb970eda75b4312a99d59f83cd
Main Page
0
1
507
506
2022-01-17T04:21:51Z
TheSink
2
Revert back to original versioning scheme
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Productions''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta 0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
76383600a33865d1b627d7663aa3e28097de7992
530
507
2022-01-30T04:13:05Z
TheSink
2
Change group name
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 2 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta 0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
de2227ca7cb1aac89a07026842de941c7985b592
538
530
2022-02-21T21:22:44Z
Lule34567
6
Fixed active developer count from 2 to 3
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.14.1'''. Development of '''Beta 0.15''' is in progress and is accessible on our [https://www.roblox.com/games/452710513/CVRF-Development-Branch development branch].
3bd931aa20a52a1213ac0d3a590f2a6b8c456421
541
538
2022-02-25T19:22:07Z
TheSink
2
Update version
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.0'''.
19871db7f51a87fe3d2521ad392af489fa73acb1
544
541
2022-03-06T06:13:31Z
TheSink
2
Update version numbers
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.0.1'''. The next build will be '''Beta 0.15.1'''.
6b98a57e9f27802f91f1c4619a2efa133eee6454
Panic switch
0
105
508
239
2022-01-17T09:24:11Z
TheSink
2
TheSink moved page [[Panic Switch]] to [[Panic switch]] without leaving a redirect: Switch to sentence case
wikitext
text/x-wiki
{{Page under construction}}
== Appearance ==
Panic Switches appear as two yellow objects hung on the wall, on a gray plate. One of the objects appear like a fire pull station but with the text being replaced with "PANIC", "PULL TO ALERT SECURITY".
0a77795c0b0d3c789668c308d3a5bc2ddbd7c5ae
511
508
2022-01-17T09:47:44Z
TheSink
2
Add extra information
wikitext
text/x-wiki
{{Page under construction}}
[[File:Panic switch.png|thumb|200x200px|A panic switch on an east-facing wall in the [[reception lobby]]]]
Panic switches (also referred to as panic stations) are devices attached to the wall that allow personnel to send out a facility-wide alert and notify security of a potential emergency. When pulled, a screen will illuminate on the device indicating it is now active, along with the location that has been transmitted to security personnel. This information will display on all panic switches across the facility, and the location will be shown on an overhead screen in the [[security department]]. A sound will also play across all switches, sets of LEDs on the front panel will begin to flash, and an intercom announcement will play.
As of Beta 0.15, there are a total of '''19''' panic stations present across the map.
== Security alerts ==
[[File:Panic switch security display.gif|thumb|The panic alarm status display present in the [[security department]] after a panic switch was triggered]]
Members of the security team will be notified of the activation of a panic switch in many ways. Besides the public-facing notifications (illumination of panic switches and intercom announcement), an overhead screen in a main hallway of the security department will show the current panic alarm status. As well as this, a message will be broadcast to all security and safety department personnel via their [[Emergency radio|emergency radios]].
5e0efcec678a97b3d3beb59714028882c78446f3
512
511
2022-01-17T09:49:23Z
TheSink
2
Grammatical corrections
wikitext
text/x-wiki
{{Page under construction}}
[[File:Panic switch.png|thumb|200x200px|A panic switch on an east-facing wall in the [[reception lobby]]]]
Panic switches (also referred to as panic stations) are devices attached to the wall that allow personnel to send out a facility-wide alert and notify security of a potential emergency. When pulled, a screen will illuminate on the device indicating it is now active, along with roughly where that panic switch is located. This information will display on all panic switches across the facility, as well as on an overhead screen in the [[security department]]. A sound will also play across all switches, sets of LEDs on the front panel will begin to flash, and an intercom announcement will play upon activation.
As of Beta 0.15, there are a total of '''19''' panic stations present across the map.
== Security alerts ==
[[File:Panic switch security display.gif|thumb|The panic alarm status display present in the [[security department]] after a panic switch was triggered]]
Members of the security team will be notified of the activation of a panic switch in many ways. Besides the public-facing notifications (illumination of panic switches and intercom announcement), an overhead screen in a main hallway of the security department will show the current panic alarm status. As well as this, a message will be broadcast to all security and safety department personnel via their [[Emergency radio|emergency radios]].
a430a230d3ff2f666a53d15a346879c1eae20687
515
512
2022-01-17T10:23:26Z
ChromeEight
7
Bold names, added spacing
wikitext
text/x-wiki
{{Page under construction}}
[[File:Panic switch.png|thumb|200x200px|A panic switch on an east-facing wall in the [[reception lobby]]]]
'''Panic switches''' (also referred to as '''panic stations''') are devices attached to the wall that allow personnel to send out a facility-wide alert and notify security of a potential emergency.
When pulled, a screen will illuminate on the device indicating it is now active, along with roughly where that panic switch is located. This information will display on all panic switches across the facility, as well as on an overhead screen in the [[security department]]. A sound will also play across all switches, sets of LEDs on the front panel will begin to flash, and an intercom announcement will play upon activation.
As of Beta 0.15, there are a total of '''19''' panic stations present across the map.
== Security alerts ==
[[File:Panic switch security display.gif|thumb|The panic alarm status display present in the [[security department]] after a panic switch was triggered]]
Members of the security team will be notified of the activation of a panic switch in many ways. Besides the public-facing notifications (illumination of panic switches and intercom announcement), an overhead screen in a main hallway of the security department will show the current panic alarm status. As well as this, a message will be broadcast to all security and safety department personnel via their [[Emergency radio|emergency radios]].
423fc37c5d19fc3abc6dd8e2a17f9404fb519555
File:Panic switch.png
6
198
509
2022-01-17T09:28:28Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Panic switch security display.gif
6
199
510
2022-01-17T09:44:55Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Intercom system
0
200
513
2022-01-17T09:53:36Z
TheSink
2
Created page with "{{Template:Page_under_construction}} The '''intercom system''' is comprised of a network of overhead speakers placed around the facility that allow important information to be broadcast to personnel at any given time. The voice that is used in intercom announcements is from the video game [https://en.wikipedia.org/wiki/Black_Mesa_(video_game)]"
wikitext
text/x-wiki
{{Template:Page_under_construction}}
The '''intercom system''' is comprised of a network of overhead speakers placed around the facility that allow important information to be broadcast to personnel at any given time. The voice that is used in intercom announcements is from the video game [https://en.wikipedia.org/wiki/Black_Mesa_(video_game)]
d7f41bbb961280ccbb330d58e815d63fe64cb5b5
514
513
2022-01-17T09:59:45Z
TheSink
2
wikitext
text/x-wiki
{{Template:Page_under_construction}}
The '''intercom system''' is comprised of a network of overhead speakers placed around the facility that allow important information to be broadcast to personnel at any given time. The voice used in intercom announcements is from [https://en.wikipedia.org/wiki/Black_Mesa_(video_game) ''Black Mesa''].
fb4eebf2454f852ca6d75834730962efea9d8020
Cafeteria
0
112
516
415
2022-01-17T10:40:59Z
ChromeEight
7
Added development history
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
== Development history ==
The Cafeteria was first added sometime in Beta 0.5 to 0.7, around the same time as the Atrium. It was located at the [[Atrium|Level 3 Atrium]] and was a small diner with blue walls and checkered tiles, taking inspiration from the diners and cafeterias found in [https://fallout.fandom.com/wiki/Vault Vaults] in ''Fallout 3'' and ''Fallout: New Vegas''.
During the Atrium overhaul in Beta 0.8 to 0.9, the Cafeteria was moved to Level 4 in Sector D, taking the space formerly occupied by the Control Room, which was moved further north. The former space occupied by the Cafeteria was converted into the Atrium Lounge. In the process, the entire Cafeteria was redesigned as a two-level open space. This layout takes inspiration from the cafeteria in [https://half-life.fandom.com/wiki/Half-Life ''Half-Life 1''] (and its community mod remake [https://half-life.fandom.com/wiki/Black_Mesa_(game) ''Black Mesa'']) found in Sector D in the game chapter [https://half-life.fandom.com/wiki/Office_Complex ''Office Complex'']. In the Foundation Update (Beta 0.12), Level 4 was reclassified as Level 5.
In the upcoming Beta 0.15, minor design changes were added to the Cafeteria. The new Sector D Office Annex hallway wraps around the Cafeteria itself, creating the need for a second door on the west side of the Cafeteria. The east entrance was also upgraded to use two doors instead of one. The layout of the tables and chairs were also updated to be less random and to provide better navigability. New plants, a tray return area, and ground work for the kitchen area were also added. In this update, the PBOP-era grid art frames were replaced by rentable advertisement space.
[[Category:Locations]]
6560825e14f601cd18ce184520dbb49dd5abc54e
517
516
2022-01-17T10:41:53Z
ChromeEight
7
/* Development history */ Hyperlinks for F3 and FNV
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
== Development history ==
The Cafeteria was first added sometime in Beta 0.5 to 0.7, around the same time as the Atrium. It was located at the [[Atrium|Level 3 Atrium]] and was a small diner with blue walls and checkered tiles, taking inspiration from the diners and cafeterias found in [https://fallout.fandom.com/wiki/Vault Vaults] in [https://fallout.fandom.com/wiki/Fallout_3 ''Fallout 3''] and [https://fallout.fandom.com/wiki/Fallout:_New_Vegas ''Fallout: New Vegas''].
During the Atrium overhaul in Beta 0.8 to 0.9, the Cafeteria was moved to Level 4 in Sector D, taking the space formerly occupied by the Control Room, which was moved further north. The former space occupied by the Cafeteria was converted into the Atrium Lounge. In the process, the entire Cafeteria was redesigned as a two-level open space. This layout takes inspiration from the cafeteria in [https://half-life.fandom.com/wiki/Half-Life ''Half-Life 1''] (and its community mod remake [https://half-life.fandom.com/wiki/Black_Mesa_(game) ''Black Mesa'']) found in Sector D in the game chapter [https://half-life.fandom.com/wiki/Office_Complex ''Office Complex'']. In the Foundation Update (Beta 0.12), Level 4 was reclassified as Level 5.
In the upcoming Beta 0.15, minor design changes were added to the Cafeteria. The new Sector D Office Annex hallway wraps around the Cafeteria itself, creating the need for a second door on the west side of the Cafeteria. The east entrance was also upgraded to use two doors instead of one. The layout of the tables and chairs were also updated to be less random and to provide better navigability. New plants, a tray return area, and ground work for the kitchen area were also added. In this update, the PBOP-era grid art frames were replaced by rentable advertisement space.
[[Category:Locations]]
ca2a0ca99986e88cf51125b6fcf41453966675f4
519
517
2022-01-17T23:27:15Z
TheSink
2
Add screenshot of cafeteria
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
[[File:Cafeteria 15.png|thumb|The cafeteria as seen in Beta 0.15]]
The '''Cafeteria''' is a location on [[Level 5]] in [[Sector D]]. It is one of the largest recreational locations in the facility, and will offer consumable food in a future update.
== Development history ==
The Cafeteria was first added sometime in Beta 0.5 to 0.7, around the same time as the Atrium. It was located at the [[Atrium|Level 3 Atrium]] and was a small diner with blue walls and checkered tiles, taking inspiration from the diners and cafeterias found in [https://fallout.fandom.com/wiki/Vault Vaults] in [https://fallout.fandom.com/wiki/Fallout_3 ''Fallout 3''] and [https://fallout.fandom.com/wiki/Fallout:_New_Vegas ''Fallout: New Vegas''].
During the Atrium overhaul in Beta 0.8 to 0.9, the Cafeteria was moved to Level 4 in Sector D, taking the space formerly occupied by the Control Room, which was moved further north. The former space occupied by the Cafeteria was converted into the Atrium Lounge. In the process, the entire Cafeteria was redesigned as a two-level open space. This layout takes inspiration from the cafeteria in [https://half-life.fandom.com/wiki/Half-Life ''Half-Life 1''] (and its community mod remake [https://half-life.fandom.com/wiki/Black_Mesa_(game) ''Black Mesa'']) found in Sector D in the game chapter [https://half-life.fandom.com/wiki/Office_Complex ''Office Complex'']. In the Foundation Update (Beta 0.12), Level 4 was reclassified as Level 5.
In the upcoming Beta 0.15, minor design changes were added to the Cafeteria. The new Sector D Office Annex hallway wraps around the Cafeteria itself, creating the need for a second door on the west side of the Cafeteria. The east entrance was also upgraded to use two doors instead of one. The layout of the tables and chairs were also updated to be less random and to provide better navigability. New plants, a tray return area, and ground work for the kitchen area were also added. In this update, the PBOP-era grid art frames were replaced by rentable advertisement space.
[[Category:Locations]]
5cea3000648df01bda316694b4f25eac9d25f332
File:Cafeteria 15.png
6
201
518
2022-01-17T23:22:27Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Crowbar
0
202
520
2022-01-19T16:55:11Z
ChromeEight
7
Created page
wikitext
text/x-wiki
The '''crowbar''' is a melee weapon in the game that can be used to inflict minor damage against creatures and other players. Like other weapons, it can also be used on door switches to force them to open for a brief amount of time.
It is a clear reference to the crowbar in the Half-Life series.
== Stats ==
The crowbar deals a raw damage of 5 HP against creatures and players. This however can be increased by random critical hits, which can increase the damage to 15 HP.
== Locations ==
* There are two crowbars on the wall at both ends of the Headcrab Lab on Level 3, Sector C East.
6e2c4610c601ef164da679753ca760d7c787bda5
OofLiberator
0
203
521
2022-01-19T17:05:34Z
ChromeEight
7
Created page
wikitext
text/x-wiki
{{Template:Spoilers}}
The '''OofLiberator''' is an item in the game that resembles a bomb with a yellow face.
It allows for a one-time use to breach the wall of the Headcrab Lab from the Sector C East hallway, allowing headcrabs to run amok.
== Location ==
* Found in a Plasma Inc crate in the Cult Closet.
d707f58d70e6582e4963cda9faf0af377d831889
Rules
0
5
522
269
2022-01-21T16:36:42Z
TheSink
2
Fix typo
wikitext
text/x-wiki
== Manual of Style ==
This wiki uses American English grammar and spelling rules. Proper grammar will not be strongly enforced, but it is best to make all content as comprehensible as possible for the sake of readability.
=== Game versions ===
When referring to a specific version of the game, it is best to refer to its update name or the development phase with its version number, as follows:
* Examples: The Foundation Update or Beta 0.12
* Example: In Beta 0.12, the Atrium...
* Example: The facility was remodeled during The Foundation Update.
=== Dates ===
Use MM/DD/YYYY or MM/DD format.
* Examples: January 8, 2022 or January 8
=== Page names ===
All page names should be in [https://en.wikipedia.org/wiki/Letter_case#Sentence_case sentence case].
* Examples: Reception lobby, Group history, Contribution rules, Development history
== Contributing ==
* This wiki is hosted by Miraheze, and thus all content should follow their [https://meta.miraheze.org/wiki/Content_Policy Content Policy].
* Content must remain appropriate ("safe-for-work") due to the subject of the wiki and demographics of potential viewers. Not safe for work (NSFW) or inappropriate content will result in a ban.
* Pages must be relevant and provide information related to CVRF or something associated with it. Irrelevant content will be removed at the discretion of wiki moderators.
* Pages must display proper notices using notice banners regarding any significant information about the content of a page. Certain instances where a notice may be necessary include:
** Content which may be considered a spoiler, i.e. describing secrets or easter eggs ([[Template:Spoilers]])
** Pages about aspects of the game that are not yet implemented or contain work-in-progress functionality ([[Template:Work in progress]])
** Pages about removed or cancelled features ([[Template:Content removed]])
** Unfinished pages that contain partial/incomplete information on a subject or have not been laid out sufficiently enough to be considered 'ready' ([[Template:Page under construction]])
=== Etiquette ===
* You should make a concerted effort to provide as much information as possible on whatever you are describing. Work-in-progress pages are okay, but should not be considered 'finished' if they only contain one or two sentences (in most cases).
* Use comments for editor notes. Placing it just in the wiki content doesn't exactly look good.
These contribution rules and page guidelines apply everywhere, to all methods a wiki editor can contribute to the site.
* It is highly encouraged to leave an edit summary after editing pages for transparency and edit history navigation purposes.
* Moderator and developers have the final say on any content on the wiki. As such, you should not re-add any content that may be removed by a moderator or developer if there is a given reason for its removal.
== Behavior ==
* Creating alternate accounts is discouraged.
* Do not vandalize or leave spam on any pages, including user pages and talk pages.
** This includes blanking pages, removing entire sections without a justified reason, or changing parts of the page into jokes.
* Please be civil on talk pages. Always leave constructive criticism and be clear on what aspects should be improved upon. Inappropriate behavior will result in a ban.
2cb885bbbd3469fd6f8898e309d6146acb43ef15
File:Headcrab lab.png
6
204
523
2022-01-30T03:13:39Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Headcrab Parasitology Lab
0
205
524
2022-01-30T03:17:21Z
TheSink
2
Create page for headcrab lab
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector D]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
3b3c095dab77fb8890800fe0495db457e74feefd
545
524
2022-03-06T06:15:26Z
TheSink
2
TheSink moved page [[Headcrab parasitology lab]] to [[Headcrab Parasitology Lab]]: Switch to sentence case
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector D]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
3b3c095dab77fb8890800fe0495db457e74feefd
547
545
2022-03-06T06:17:36Z
TheSink
2
Fix sector
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector D|Sector C]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
e40b0fa830a93e98918fc583e777995dab595cc0
548
547
2022-03-06T06:17:59Z
TheSink
2
Fix link to sector (oops)
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector C]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
6ed06b17f374f1bfb0621bb31feba6ba42edbd09
553
548
2022-03-06T06:57:18Z
TheSink
2
Add lab category
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector C]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
[[Category:Lab]]
f7b64e6b18b8c26e6dac2104887de7dd3298fed6
555
553
2022-03-06T06:59:30Z
TheSink
2
Correct category name (pluralize)
wikitext
text/x-wiki
{{Page under construction}}
[[File:Headcrab lab.png|thumb|A view into the inner chamber, as seen from the southern side]]
The '''Headcrab Parasitology Lab''' (Lab CE-1) is a research lab located on Level 3 in [[Sector C]]. Its objective is to research [[Headcrab|Headcrabs]] - parasitic organisms from the [https://en.wikipedia.org/wiki/Half-Life_(series) ''Half-Life series''] and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]'' that quickly kill after latching onto a victim's head.
[[Category:Locations]]
[[Category:Labs]]
1a68c432e07a9b7610f3f0464459c5c3839f5783
Facility Locations
0
16
525
259
2022-01-30T03:18:36Z
TheSink
2
Add link to headcrab lab
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 3 and 4 and houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*Tram Station 3
*Infirmary
*Living Quarters
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (M-01)
*Geological Survey Lab (M-02)
*Tram Station 5
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
cccb013ca6a01be37e638fd2224f36d0516004ad
531
525
2022-01-31T18:16:23Z
AyScorch
5
Modifed Sector C description a bit, added links and text for living quarters, added Sector E new labs
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*Tram Station 1
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*Tram Station 2
*Tram Station 4
*Tram Station 6
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*Tram Station 3
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*Tram Station 5
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
466384903ebfb2191538c26697f04806b072786f
534
531
2022-02-12T05:07:20Z
TheSink
2
Add links to tram stations
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*[[Tram system#Sector A Sublevel (Station 1)|Tram Station 1]]
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*[[Tram system#Cargo Bay (Station 2)|Tram Station 2]]
*[[Tram system#Sector C East (Station 4)|Tram Station 4]]
*[[Tram system#Sector C West (Station 6)|Tram Station 6]]
*Server Room
*Cargo Bay and Logistics Hub
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*[[Tram system#Security Checkpoint (Station 3)|Tram Station 3]]
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*[[Tram system#Sector E Materials (Station 5)|Tram Station 5]]
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
9ce63fd6f5f9999a636980c9b1662e9def650d97
537
534
2022-02-12T05:17:09Z
TheSink
2
Add link for cargo bay
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*[[Tram system#Sector A Sublevel (Station 1)|Tram Station 1]]
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*[[Tram system#Cargo Bay (Station 2)|Tram Station 2]]
*[[Tram system#Sector C East (Station 4)|Tram Station 4]]
*[[Tram system#Sector C West (Station 6)|Tram Station 6]]
*Server Room
*[[Cargo bay|Cargo Bay]]
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#Z-Pinch Lab
#Helium Lab and Cold Storage
#Cloning Lab
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*[[Tram system#Security Checkpoint (Station 3)|Tram Station 3]]
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*[[Tram system#Sector E Materials (Station 5)|Tram Station 5]]
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
0b5c5f9aafb8aa4a2327b9bf9d22f7496bc21297
Category:Easter eggs
14
206
526
2022-01-30T03:19:35Z
TheSink
2
Created blank page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Panic rush first button.png
6
207
527
2022-01-30T03:31:32Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Panic rush second button.png
6
208
528
2022-01-30T03:31:49Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Disco mode
0
209
529
2022-01-30T03:34:08Z
TheSink
2
Add initial disco mode easter egg info
wikitext
text/x-wiki
{{Template:Spoilers}}
{{Template:Page_under_construction}}
'''Disco mode''' is an easter egg in which lighting in the [[Atrium]] will begin to switch to random colors alongside disco music that players throughout the area. The music plays for about 5 ½ minutes before the lighting effects are reset and the music finishes.
== Activating the effect ==
[[File:Panic rush first button.png|thumb|178x178px|First activation button]]
To start the disco mode easter egg, two buttons in completely different locations of the facility must be pressed in succession within 10 seconds of each other. The first button is present near the wall on the southern side of the [[Headcrab parasitology lab]]. After pressing this button, a secondary button will appear on the wall in the [[Atrium]], beeping steadily to indicate it should be pressed.
[[File:Panic rush second button.png|thumb|250x250px|Second activation button]]
After the second button is pressed, it will be hidden and the event will trigger.
[[Category:Easter eggs]]
d5ca88670f9d4897e683253b13d4e920a668af15
Development history
0
106
532
245
2022-01-31T18:21:23Z
TheSink
2
Add info about group name change
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - present) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
''To be continued...''
16dd9d7f3822aab64fb4d06350e94c1332a88076
MediaWiki:Sidebar
8
25
533
65
2022-02-01T04:16:22Z
TheSink
2
Protected "[[MediaWiki:Sidebar]]": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
** Rules|Wiki rules
* Useful Links
** https://www.roblox.com/groups/970502/JK-Production#!/about|Roblox Group
** https://discord.gg/ytBqnKN|Discord Server
** https://tree.taiga.io/project/thesinkgod-jkr-research-facility/timeline|Project Tracker
* SEARCH
* TOOLBOX
* LANGUAGES
c2499450b887cd77ea113fb62cc0caab60007b84
File:Cargo bay.png
6
210
535
2022-02-12T05:14:57Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Cargo bay
0
211
536
2022-02-12T05:16:30Z
TheSink
2
Create cargo bay page
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Cargo bay.png|thumb|The cargo bay as seen in Update 0.15]]
The '''cargo bay''' is a location on [[Level 3]] in [[Sector C]]. It acts as the primary hub for cargo being moved in and out of the facility. In addition to a central 'buffer' space for cargo to be temporarily stored, the cargo bay has eight total bays (four incoming, four outgoing) for freight vehicles to park at when loading and unloading cargo. A tunnel and freight elevator directly connects the cargo bay with a [[topside warehouse]], with a security checkpoint in-between to ensure no unauthorized vehicles gain entry.
6c3064c84d993cd8adc2ed333036be9a0cd6f951
User talk:Lule34567
3
212
539
2022-02-21T21:24:28Z
Lule34567
6
Created page with "urine"
wikitext
text/x-wiki
urine
8f25a8a2a2164a726230f5ed77ee7b9a67810e12
User talk:ChromeEight
3
100
540
387
2022-02-21T21:38:23Z
Lule34567
6
wikitext
text/x-wiki
why did it get purged
--[[User:Lule34567|Lule34567]] ([[User talk:Lule34567|talk]]) 21:38, 21 February 2022 (UTC)
8b9d9cbfebc0545fca1ce7f812f4f3f5638c1980
Server Panel
0
213
542
2022-02-26T15:21:05Z
ChromeEight
7
Created page
wikitext
text/x-wiki
The '''Server Panel''', also known as the '''Private Server Panel''' and formerly known as the '''VIP Server Panel''', is an in-game menu that allows the user to enable and disable certain aspects of the game. It is restricted only to game developers and moderators in normal gameplay and to private server owners in their private servers.
The panel can be opened by pressing the B key or by pressing the Server Panel button on the upper right of the screen.
== Features ==
The available options on the server panel are divided into three categories. Gameplay options are mainly those that affect gameplay mechanics, such as the placement system and headcrab creatures. Facility options are those that usually concern facility operations, such as alarm and lockdown systems. Lastly, Fun options are experimental features for wacky and random fun.
=== Gameplay ===
==== Enable Headcrabs ====
* Enabled by default.
* Headcrabs spawned by pressing the'''Spawn Headcrab''' button are not covered by this setting.
* This setting does not cover Anomalies.
* When enabled, Headcrabs will spawn at a random spawn point inside the [[Headcrab parasitology lab|Headcrab Lab.]]
* When disabled, all Headcrabs will be removed from the game.
==== Enable Emergency Light Auto-Toggle ====
* Enabled by default.
* When enabled, emergency lights will turn on automatically when the facility power level is below 10%.
* When disabled, emergency lights will not turn on automatically.
==== Placement System ====
* Disabled by default.
* When enabled, all players in the server will have access to use the Placement System.
* When disabled, the Placement System will be disabled.
==== Enable Tool Dropping ====
* Introduced in Beta 0.15.0.1, where it is disabled by default.
* When enabled, players will drop all their inventory items on death.
* When disabled, all inventory items on a player will be deleted on death.
==== Clear Placed Items ====
* When pressed, all items placed using the Placement System will be removed from the game.
==== Automatic Jeep Respawn ====
* Enabled by default.
* When enabled, the game will remove all unoccupied jeeps every 15 minutes.
* When disabled, unoccupied jeeps will not despawn.
=== Facility ===
==== Enable Alarms ====
* Disabled by default.
* When enabled, all facility alarms will be activated.
* When disabled, all facility alarms will be deactivated.
==== Silence Alarms ====
* When pressed, all active facility alarms will be deactivated. Alarms will be re-activated the next time that the alarm system is enabled.
==== Enable Lockdown ====
* Disabled by default.
* When enabled, all lockdown doors in the facility will be lowered.
* When disabled, all lockdown doors in the facility will be lifted.
==== Set Power Level ====
* Default value is at 100%.
* Sets the facility power level to a value ranging from 0 to 100 percent.
==== Enable Emergency Lighting ====
* Disabled by default.
* The '''Enable Emergency Light Auto-Toggle''' setting will automatically toggle this setting in certain conditions.
* When enabled, all emergency lighting fixtures around the facility will be turned on.
* When disabled, all emergency lighting fixtures around the facility will be turned off.
==== Enable Panic Switches ====
* Enabled by default.
* Note that this setting does not affect the [[Panic Rush]] minigame.
* When enabled, players can activate panic switches.
* When disabled, players will not be able to activate panic switches.
==== Enable Tram Movement ====
* Enabled by default.
* When enabled, the tram will move along its track and the rail will be electrified.
* When disabled, the tram will not move and the rail will not be electrified.
=== Fun ===
==== Enable Hardcore Mode ====
* Disabled by default.
* When enabled, any player who is not an admin will be kicked from the game if they die.
* When disabled, any player who is not an admin will not be kicked from the game if they die.
==== Scramble Audio ====
* When pressed, all in-game audio will be scrambled with one another.
==== Unscramble Audio ====
* When pressed, it will attempt to revert the effects of the '''Scramble Audio''' setting.
==== Enable Fast Jeeps ====
* Disabled by default.
* When enabled, the maximum speed of all jeeps will be tripled.
* When disabled, the maximum speed of all jeeps will be reset.
==== Spawn Headcrab ====
* When pressed, a Headcrab will spawn at a random spawn point anywhere in the facility.
==== Spawn Anomaly ====
* When pressed, an Anomaly will spawn at a random spawn point anywhere in the facility.
==== Enable Party Lights ====
* Disabled by default.
* When enabled, alarm beacons will change to random colors when they are enabled.
* When disabled, alarm beacons will use normal alarm beacon colors.
5a8b106eb8175b5cb9e80d287ca81ab515d76aa9
543
542
2022-03-01T14:42:00Z
AyScorch
5
Added space
wikitext
text/x-wiki
The '''Server Panel''', also known as the '''Private Server Panel''' and formerly known as the '''VIP Server Panel''', is an in-game menu that allows the user to enable and disable certain aspects of the game. It is restricted only to game developers and moderators in normal gameplay and to private server owners in their private servers.
The panel can be opened by pressing the B key or by pressing the Server Panel button on the upper right of the screen.
== Features ==
The available options on the server panel are divided into three categories. Gameplay options are mainly those that affect gameplay mechanics, such as the placement system and headcrab creatures. Facility options are those that usually concern facility operations, such as alarm and lockdown systems. Lastly, Fun options are experimental features for wacky and random fun.
=== Gameplay ===
==== Enable Headcrabs ====
* Enabled by default.
* Headcrabs spawned by pressing the '''Spawn Headcrab''' button are not covered by this setting.
* This setting does not cover Anomalies.
* When enabled, Headcrabs will spawn at a random spawn point inside the [[Headcrab parasitology lab|Headcrab Lab.]]
* When disabled, all Headcrabs will be removed from the game.
==== Enable Emergency Light Auto-Toggle ====
* Enabled by default.
* When enabled, emergency lights will turn on automatically when the facility power level is below 10%.
* When disabled, emergency lights will not turn on automatically.
==== Placement System ====
* Disabled by default.
* When enabled, all players in the server will have access to use the Placement System.
* When disabled, the Placement System will be disabled.
==== Enable Tool Dropping ====
* Introduced in Beta 0.15.0.1, where it is disabled by default.
* When enabled, players will drop all their inventory items on death.
* When disabled, all inventory items on a player will be deleted on death.
==== Clear Placed Items ====
* When pressed, all items placed using the Placement System will be removed from the game.
==== Automatic Jeep Respawn ====
* Enabled by default.
* When enabled, the game will remove all unoccupied jeeps every 15 minutes.
* When disabled, unoccupied jeeps will not despawn.
=== Facility ===
==== Enable Alarms ====
* Disabled by default.
* When enabled, all facility alarms will be activated.
* When disabled, all facility alarms will be deactivated.
==== Silence Alarms ====
* When pressed, all active facility alarms will be deactivated. Alarms will be re-activated the next time that the alarm system is enabled.
==== Enable Lockdown ====
* Disabled by default.
* When enabled, all lockdown doors in the facility will be lowered.
* When disabled, all lockdown doors in the facility will be lifted.
==== Set Power Level ====
* Default value is at 100%.
* Sets the facility power level to a value ranging from 0 to 100 percent.
==== Enable Emergency Lighting ====
* Disabled by default.
* The '''Enable Emergency Light Auto-Toggle''' setting will automatically toggle this setting in certain conditions.
* When enabled, all emergency lighting fixtures around the facility will be turned on.
* When disabled, all emergency lighting fixtures around the facility will be turned off.
==== Enable Panic Switches ====
* Enabled by default.
* Note that this setting does not affect the [[Panic Rush]] minigame.
* When enabled, players can activate panic switches.
* When disabled, players will not be able to activate panic switches.
==== Enable Tram Movement ====
* Enabled by default.
* When enabled, the tram will move along its track and the rail will be electrified.
* When disabled, the tram will not move and the rail will not be electrified.
=== Fun ===
==== Enable Hardcore Mode ====
* Disabled by default.
* When enabled, any player who is not an admin will be kicked from the game if they die.
* When disabled, any player who is not an admin will not be kicked from the game if they die.
==== Scramble Audio ====
* When pressed, all in-game audio will be scrambled with one another.
==== Unscramble Audio ====
* When pressed, it will attempt to revert the effects of the '''Scramble Audio''' setting.
==== Enable Fast Jeeps ====
* Disabled by default.
* When enabled, the maximum speed of all jeeps will be tripled.
* When disabled, the maximum speed of all jeeps will be reset.
==== Spawn Headcrab ====
* When pressed, a Headcrab will spawn at a random spawn point anywhere in the facility.
==== Spawn Anomaly ====
* When pressed, an Anomaly will spawn at a random spawn point anywhere in the facility.
==== Enable Party Lights ====
* Disabled by default.
* When enabled, alarm beacons will change to random colors when they are enabled.
* When disabled, alarm beacons will use normal alarm beacon colors.
2f3614ac8f382b3dc2edee45827f92660ae7abeb
Headcrab parasitology lab
0
214
546
2022-03-06T06:15:26Z
TheSink
2
TheSink moved page [[Headcrab parasitology lab]] to [[Headcrab Parasitology Lab]]: Switch to sentence case
wikitext
text/x-wiki
#REDIRECT [[Headcrab Parasitology Lab]]
8516b8accfc4f9f5657c45cbb4592a2866b1d8f7
File:Clonelab.png
6
215
549
2022-03-06T06:20:45Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Clonelab chambers.png
6
216
550
2022-03-06T06:23:40Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Cloningfailure.png
6
217
551
2022-03-06T06:40:28Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Clone Lab
0
218
552
2022-03-06T06:57:04Z
TheSink
2
Create clone lab article
wikitext
text/x-wiki
{{Page under construction}}
[[File:Clonelab.png|thumb|A view of the clone lab, demonstrating an active cloning process that would produce a bot]]
The '''Clone Lab''' (Lab CE-6) is a research lab located on Level 3 in [[Sector C]]. It allows players to clone one another by various means. Players can be cloned into other players (duplicating the appearance of the person in the "sample" chamber), or a simple bot can be created in the "target" chamber if unoccupied, that will somewhat attempt to follow its host around unless out of range.
== Specimen chambers ==
There are two specimen chambers in this lab: the '''sample''' chamber (left), and the '''target''' chamber (right). The sample chamber contains the player looking to be cloned, and the target contains the player who is being cloned into (or nothing, if you are intending to produce a bot).
These chambers are metal with glass windows on the sides, wrapping around partially to the front, with the interior containing an emitter on the top and bottom that will spin when the process is initiated. As well as this, a glow will begin to emanate from the chamber in the seconds prior to the cloning operation concluding.
[[File:Clonelab chambers.png|thumb|The two '''specimen chambers''' used to clone subjects]]
== Lab operation ==
* To clone one player ''into'' another (copying character appearance and physical proportions), a player must be present inside both chambers at once. The "clone sample" switch on the control desk can be pressed to initiate the process, which should take around 10 seconds in total.
* To clone one player into a ''bot'', leave the target chamber empty. Keep in mind, someone must be in the sample chamber any time a cloning operation is conducted. Bots have 20% of a normal player's health, and thus are more vulnerable to injury.
The process can be aborted at any time by pressing the "emergency stop" switch, directly adjacent to the "clone sample" switch.
== Cloning failure ==
[[File:Cloningfailure.png|thumb|A particularly extreme example of a failed cloning attempt]]
A cloning failure can occur randomly, and results in the body proportions of the resulting entity (a player or a bot in the target chamber after the process has completed) being disrupted, as well as an unpredictable decrease in health. The chance of a cloning failure occurring rises after each successful operation of the lab, and will reset back to 0 once a failure has occurred.
== Learning & dialog ==
Bot clones are able to record and learn about chat messages that other players have spoken in its immediate vicinity (or in the case of its host, anywhere in the game). This learning is very rudimentary, making use of a [https://en.wikipedia.org/wiki/Markov_chain ''Markov chain''] text generator to produce new messages. Therefore, players can "teach" bots by speaking around them, and intentionally cherry-picking messages they would like bots to absorb and repeat.
Keep in mind, learning is not persistent and any data learned by a bot will be erased in any scenario in which that bot is removed from the game (specifically after dying, or during a server shutdown). In the future, a method of saving this data and recalling it later in a new bot will be implemented.
An Easter egg implemented in 0.15.1 involves saying "melon" around a bot clone, which has a slight chance of angering it into chasing said player around, and will explode once in a certain proximity. This is a reference to the video game [https://en.wikipedia.org/wiki/Fa%C3%A7ade_(video_game) ''Façade''].
[[Category:Locations]]
[[Category:Lab]]
[[Category:Easter eggs]]
df81a1eeef8871afe9ae66ecb9b0dae802680a52
554
552
2022-03-06T06:58:04Z
TheSink
2
Correct category name (pluralize)
wikitext
text/x-wiki
{{Page under construction}}
[[File:Clonelab.png|thumb|A view of the clone lab, demonstrating an active cloning process that would produce a bot]]
The '''Clone Lab''' (Lab CE-6) is a research lab located on Level 3 in [[Sector C]]. It allows players to clone one another by various means. Players can be cloned into other players (duplicating the appearance of the person in the "sample" chamber), or a simple bot can be created in the "target" chamber if unoccupied, that will somewhat attempt to follow its host around unless out of range.
== Specimen chambers ==
There are two specimen chambers in this lab: the '''sample''' chamber (left), and the '''target''' chamber (right). The sample chamber contains the player looking to be cloned, and the target contains the player who is being cloned into (or nothing, if you are intending to produce a bot).
These chambers are metal with glass windows on the sides, wrapping around partially to the front, with the interior containing an emitter on the top and bottom that will spin when the process is initiated. As well as this, a glow will begin to emanate from the chamber in the seconds prior to the cloning operation concluding.
[[File:Clonelab chambers.png|thumb|The two '''specimen chambers''' used to clone subjects]]
== Lab operation ==
* To clone one player ''into'' another (copying character appearance and physical proportions), a player must be present inside both chambers at once. The "clone sample" switch on the control desk can be pressed to initiate the process, which should take around 10 seconds in total.
* To clone one player into a ''bot'', leave the target chamber empty. Keep in mind, someone must be in the sample chamber any time a cloning operation is conducted. Bots have 20% of a normal player's health, and thus are more vulnerable to injury.
The process can be aborted at any time by pressing the "emergency stop" switch, directly adjacent to the "clone sample" switch.
== Cloning failure ==
[[File:Cloningfailure.png|thumb|A particularly extreme example of a failed cloning attempt]]
A cloning failure can occur randomly, and results in the body proportions of the resulting entity (a player or a bot in the target chamber after the process has completed) being disrupted, as well as an unpredictable decrease in health. The chance of a cloning failure occurring rises after each successful operation of the lab, and will reset back to 0 once a failure has occurred.
== Learning & dialog ==
Bot clones are able to record and learn about chat messages that other players have spoken in its immediate vicinity (or in the case of its host, anywhere in the game). This learning is very rudimentary, making use of a [https://en.wikipedia.org/wiki/Markov_chain ''Markov chain''] text generator to produce new messages. Therefore, players can "teach" bots by speaking around them, and intentionally cherry-picking messages they would like bots to absorb and repeat.
Keep in mind, learning is not persistent and any data learned by a bot will be erased in any scenario in which that bot is removed from the game (specifically after dying, or during a server shutdown). In the future, a method of saving this data and recalling it later in a new bot will be implemented.
An Easter egg implemented in 0.15.1 involves saying "melon" around a bot clone, which has a slight chance of angering it into chasing said player around, and will explode once in a certain proximity. This is a reference to the video game [https://en.wikipedia.org/wiki/Fa%C3%A7ade_(video_game) ''Façade''].
[[Category:Locations]]
[[Category:Easter eggs]]
[[Category:Labs]]
46236bbdcfecab2801891c85ce5e8c4422c6b90f
Category:Labs
14
219
556
2022-03-06T07:00:03Z
TheSink
2
Create category page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Food Labs
0
108
557
420
2022-03-06T07:00:58Z
TheSink
2
Add Labs category
wikitext
text/x-wiki
The '''Food Labs''' was a laboratory located on Level 2. It was the first lab ever added to the game and was suggested by user Shredder914.
The lab contained several tables and a machine that would produce synthetic bananas onto a conveyor belt and subsequently incinerate them. A broom was kept on the wall in the event that the synthetic bananas spilled out of the conveyor belt.
An unofficial preserved copy of the Food Labs can be found [https://www.roblox.com/games/1932480100/The-Food-Lab-from-HTRF-0-11 here].
== Development history ==
In Alpha and early Beta builds, the Food Labs was located along a hallway between the Atrium staircase and the hallway fork going to the looped hallway towards the other labs on Level 2.
When the [[Atrium]] and lab hallways were redesigned in Beta 0.8, the Food Labs was moved to the Blue Hallway as the sole lab in the Food Science nook. However, in Beta 0.11, the Food Labs was removed from the game in an effort to clean up the lab lineup in the facility.
[[Category:Locations]]
[[Category:Labs]]
1f798f2f7e1d1b8c725dc1dc041b126e432d00f9
Clone Lab
0
218
558
554
2022-03-06T07:02:51Z
TheSink
2
Fix image spacing
wikitext
text/x-wiki
{{Page under construction}}
[[File:Clonelab.png|thumb|A view of the clone lab, demonstrating an active cloning process that would produce a bot]]
The '''Clone Lab''' (Lab CE-6) is a research lab located on Level 3 in [[Sector C]]. It allows players to clone one another by various means. Players can be cloned into other players (duplicating the appearance of the person in the "sample" chamber), or a simple bot can be created in the "target" chamber if unoccupied, that will somewhat attempt to follow its host around unless out of range.
== Specimen chambers ==
[[File:Clonelab chambers.png|thumb|The two '''specimen chambers''' used to clone subjects]]There are two specimen chambers in this lab: the '''sample''' chamber (left), and the '''target''' chamber (right). The sample chamber contains the player looking to be cloned, and the target contains the player who is being cloned into (or nothing, if you are intending to produce a bot).
These chambers are metal with glass windows on the sides, wrapping around partially to the front, with the interior containing an emitter on the top and bottom that will spin when the process is initiated. As well as this, a glow will begin to emanate from the chamber in the seconds prior to the cloning operation concluding.
== Lab operation ==
* To clone one player ''into'' another (copying character appearance and physical proportions), a player must be present inside both chambers at once. The "clone sample" switch on the control desk can be pressed to initiate the process, which should take around 10 seconds in total.
* To clone one player into a ''bot'', leave the target chamber empty. Keep in mind, someone must be in the sample chamber any time a cloning operation is conducted. Bots have 20% of a normal player's health, and thus are more vulnerable to injury.
The process can be aborted at any time by pressing the "emergency stop" switch, directly adjacent to the "clone sample" switch.
== Cloning failure ==
[[File:Cloningfailure.png|thumb|A particularly extreme example of a failed cloning attempt]]
A cloning failure can occur randomly, and results in the body proportions of the resulting entity (a player or a bot in the target chamber after the process has completed) being disrupted, as well as an unpredictable decrease in health. The chance of a cloning failure occurring rises after each successful operation of the lab, and will reset back to 0 once a failure has occurred.
== Learning & dialog ==
Bot clones are able to record and learn about chat messages that other players have spoken in its immediate vicinity (or in the case of its host, anywhere in the game). This learning is very rudimentary, making use of a [https://en.wikipedia.org/wiki/Markov_chain ''Markov chain''] text generator to produce new messages. Therefore, players can "teach" bots by speaking around them, and intentionally cherry-picking messages they would like bots to absorb and repeat.
Keep in mind, learning is not persistent and any data learned by a bot will be erased in any scenario in which that bot is removed from the game (specifically after dying, or during a server shutdown). In the future, a method of saving this data and recalling it later in a new bot will be implemented.
An Easter egg implemented in 0.15.1 involves saying "melon" around a bot clone, which has a slight chance of angering it into chasing said player around, and will explode once in a certain proximity. This is a reference to the video game [https://en.wikipedia.org/wiki/Fa%C3%A7ade_(video_game) ''Façade''].
[[Category:Locations]]
[[Category:Easter eggs]]
[[Category:Labs]]
8984583b7a8a6901b21d285cb4fbe5ca13a01e7a
560
558
2022-03-06T07:07:56Z
TheSink
2
Add dialog example
wikitext
text/x-wiki
{{Page under construction}}
[[File:Clonelab.png|thumb|A view of the clone lab, demonstrating an active cloning process that would produce a bot]]
The '''Clone Lab''' (Lab CE-6) is a research lab located on Level 3 in [[Sector C]]. It allows players to clone one another by various means. Players can be cloned into other players (duplicating the appearance of the person in the "sample" chamber), or a simple bot can be created in the "target" chamber if unoccupied, that will somewhat attempt to follow its host around unless out of range.
== Specimen chambers ==
[[File:Clonelab chambers.png|thumb|The two '''specimen chambers''' used to clone subjects]]There are two specimen chambers in this lab: the '''sample''' chamber (left), and the '''target''' chamber (right). The sample chamber contains the player looking to be cloned, and the target contains the player who is being cloned into (or nothing, if you are intending to produce a bot).
These chambers are metal with glass windows on the sides, wrapping around partially to the front, with the interior containing an emitter on the top and bottom that will spin when the process is initiated. As well as this, a glow will begin to emanate from the chamber in the seconds prior to the cloning operation concluding.
== Lab operation ==
* To clone one player ''into'' another (copying character appearance and physical proportions), a player must be present inside both chambers at once. The "clone sample" switch on the control desk can be pressed to initiate the process, which should take around 10 seconds in total.
* To clone one player into a ''bot'', leave the target chamber empty. Keep in mind, someone must be in the sample chamber any time a cloning operation is conducted. Bots have 20% of a normal player's health, and thus are more vulnerable to injury.
The process can be aborted at any time by pressing the "emergency stop" switch, directly adjacent to the "clone sample" switch.
== Cloning failure ==
[[File:Cloningfailure.png|thumb|A particularly extreme example of a failed cloning attempt]]
A cloning failure can occur randomly, and results in the body proportions of the resulting entity (a player or a bot in the target chamber after the process has completed) being disrupted, as well as an unpredictable decrease in health. The chance of a cloning failure occurring rises after each successful operation of the lab, and will reset back to 0 once a failure has occurred.
== Learning & dialog ==
[[File:Botdialogexample.png|thumb|An example of clone dialog, produced by three topics mentioned in nearby conversation: [https://en.wikipedia.org/wiki/Hector_(cloud) Hector] (the name of a cloud), being ''satiated'', and the [[Cafeteria]].]]
Bot clones are able to record and learn about chat messages that other players have spoken in its immediate vicinity (or in the case of its host, anywhere in the game). This learning is very rudimentary, making use of a [https://en.wikipedia.org/wiki/Markov_chain ''Markov chain''] text generator to produce new messages. Therefore, players can "teach" bots by speaking around them, and intentionally cherry-picking messages they would like bots to absorb and repeat.
Keep in mind, learning is not persistent and any data learned by a bot will be erased in any scenario in which that bot is removed from the game (specifically after dying, or during a server shutdown). In the future, a method of saving this data and recalling it later in a new bot will be implemented.
An Easter egg implemented in 0.15.1 involves saying "melon" around a bot clone, which has a slight chance of angering it into chasing said player around, and will explode once in a certain proximity. This is a reference to the video game [https://en.wikipedia.org/wiki/Fa%C3%A7ade_(video_game) ''Façade''].
[[Category:Locations]]
[[Category:Easter eggs]]
[[Category:Labs]]
380dc7a7462310d56308ba99030f3901998ea541
File:Botdialogexample.png
6
220
559
2022-03-06T07:05:51Z
TheSink
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Facility Locations
0
16
561
537
2022-03-08T14:10:35Z
ChromeEight
7
/* Sector C East Labs */ Add links
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*[[Tram system#Sector A Sublevel (Station 1)|Tram Station 1]]
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*[[Tram system#Cargo Bay (Station 2)|Tram Station 2]]
*[[Tram system#Sector C East (Station 4)|Tram Station 4]]
*[[Tram system#Sector C West (Station 6)|Tram Station 6]]
*Server Room
*[[Cargo bay|Cargo Bay]]
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#[[Z-Pinch Lab]]
#Helium Lab and Cold Storage
#[[Cloning Lab]]
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception Lobby (location)|Reception Lobby]]
*Control Room
*[[Cafeteria (location)|Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*[[Tram system#Security Checkpoint (Station 3)|Tram Station 3]]
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*[[Tram system#Sector E Materials (Station 5)|Tram Station 5]]
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
36f126c75061edf135f0772df7b20375149c2a86
563
561
2022-03-14T09:04:27Z
KcinnaJlol
10
/* Sector D - Administration and Recreation Sector */ Change some links to point to existing pages
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*[[Tram system#Sector A Sublevel (Station 1)|Tram Station 1]]
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*[[Tram system#Cargo Bay (Station 2)|Tram Station 2]]
*[[Tram system#Sector C East (Station 4)|Tram Station 4]]
*[[Tram system#Sector C West (Station 6)|Tram Station 6]]
*Server Room
*[[Cargo bay|Cargo Bay]]
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#[[Z-Pinch Lab]]
#Helium Lab and Cold Storage
#[[Cloning Lab]]
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception lobby]]
*Control Room
*[[Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*[[Tram system#Security Checkpoint (Station 3)|Tram Station 3]]
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*[[Tram system#Sector E Materials (Station 5)|Tram Station 5]]
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
5405979bec44cf55a02982d292a66c76964a1cc5
579
563
2022-05-18T15:04:20Z
KcinnaJlol
10
Fix broken redirect
wikitext
text/x-wiki
{{Template:Page_under_construction}}
{{Work in progress}}
== Sector A - Geothermal Sublevel ==
The Geothermal sublevel spans levels 1 through -2. The sector houses the Geothermal Wells and other equipment used to generate power for the facility.
*Turbine Hall
*[[Tram system#Sector A Sublevel (Station 1)|Tram Station 1]]
*Geothermal Walkway
*Lower Atrium
==Sector B - Maintenance and Utilities Sector==
The Maintenance and Utilities Sector spans Level 2 (with a much lower area accessible) and houses miscellaneous utilities for the running of the facility. This also houses larger laboratories that can't fit in Sector C.
* Waste Silo 1
* Waste Silo 2
==Sector C - General Research and Development Sector==
The General Research and Development Sector spans levels 2, 3, and 4; houses most of the laboratories in the facility, and is split into East and West areas. This sector also houses the Cargo Bay and Logistics Hub.
===Miscellaneous Locations===
*[[Tram system#Cargo Bay (Station 2)|Tram Station 2]]
*[[Tram system#Sector C East (Station 4)|Tram Station 4]]
*[[Tram system#Sector C West (Station 6)|Tram Station 6]]
*Server Room
*[[Cargo bay|Cargo Bay]]
*Atrium Lounge
*Maintenance Walkway
*SMA Room
*[[Living quarters|Level 2 East Living Quarters]]
*[[Living quarters|Level 3 North Living Quarters]]
===Sector C East Labs===
#[[Headcrab parasitology lab|Headcrab Parasitology Lab]]
#Seed Bank
#Hydroponics Farm
#[[Z-Pinch Lab]]
#Helium Lab and Cold Storage
#[[Clone Lab|Cloning Lab]]
#Unused Lab Space
#Unused Lab Space
===Sector C West Labs===
#Unused Lab Space
#Water Distillation Lab
#Helium Lab and Cold Storage
#Chemical Laser Lab
#Genetics Lab
#Waveform Manipulation Lab
==Sector D - Administration and Recreation Sector==
The Administration and Recreation Sector spans levels 4, 5, and 6 and houses living space and recreation space for members of the facility. The sector also houses the Security and Safety areas, as well as the exit points.
* [[Reception lobby]]
*Control Room
*[[Cafeteria]]
*Freight Checkpoint
*Topside Stairwell
*[[Tram system#Security Checkpoint (Station 3)|Tram Station 3]]
*Infirmary
*[[Living quarters|Level 5 North Living Quarters]]
*[[Living quarters|Level 5 South Living Quarters]]
*Topside Access Point
*Unused room™
*Accounting
=== Areas in the Safety Department ===
* Safety Department Lobby
* Emergency Management Office
* Simulation Area
* Clean Room
* Safety Demos
=== Areas in the Security Department ===
* Security Armory
* Firing Range
* Security Atrium(s)
* Detention Block
* Questioning Room
* Lounge
* Training Area
* Overseers Office
* Security Office
* Meeting Room A
==Sector E - Materials Research and Handling Sector==
The Materials Research and Handling Sector is the smallest sector so far, spanning only level 3 (with the Tram Station dipping into Level 2) and houses only 2 lab spaces so far.
*Unused Lab Space (E-01)
*Geological Survey Lab (E-02)
*Unknown lab involving lasers (E-03)
*Unused Lab Space (E-04)
*[[Tram system#Sector E Materials (Station 5)|Tram Station 5]]
==Other Locations==
Areas in this category span multiple sectors or cannot be placed into any specific sector.
* [[Atrium]]
* Maintenance Junction
* Ventilation
* FRS Room
* Surface
* Tram Tunnels
* Contingency Room A
__FORCETOC__
575377c96246aa34f94446d9c4d0c8f3c314923f
Main Page
0
1
562
544
2022-03-12T19:23:20Z
TheSink
2
Update version numbers
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== What is CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.1'''. The next build will be '''Beta 0.15.2'''.
c9e44161848b3e99d5d0c058fe7f3dd14a114b07
582
562
2022-09-17T20:53:03Z
Lule34567
6
Announcement added.
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== Important Announcement ==
== What Is CVRF? ==
== CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.1'''. The next build will be '''Beta 0.15.2'''.
036d39c774dfb5fd025334b9e10870a9b67a5be7
583
582
2022-09-17T21:00:30Z
Lule34567
6
fixed announcement
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
== Important Announcement ==
== CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.1'''. The next build will be '''Beta 0.15.2'''.
2d7a3aafc279c335727e82e3e7d9edcd78d092b4
584
583
2022-09-18T03:56:15Z
ChromeEight
7
/* Important Announcement */ Added announcement
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
<div style=" border:3px solid #faa81a; padding:8px; display:flex; align-content:center; flex-direction:column; align-items:center;">
<p style="font-size:large;"><b>ANNOUNCEMENT</b></p>
As of September 17, 2022, the Cobalt Valley Research Facility project has been put on '''indefinite hiatus'''. More details can be found [https://devforum.roblox.com/t/the-future-of-cvrf/1988173 here].
</div>
== CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest public build of CVRF is '''Beta 0.15.1'''. The next build will be '''Beta 0.15.2'''.
a37bc278c14569f725264c052c4755103b9c31e0
590
584
2022-12-27T23:47:07Z
Lule34567
6
fixed mistake on version info
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
<div style=" border:3px solid #faa81a; padding:8px; display:flex; align-content:center; flex-direction:column; align-items:center;">
<p style="font-size:large;"><b>ANNOUNCEMENT</b></p>
As of September 17, 2022, the Cobalt Valley Research Facility project has been put on '''indefinite hiatus'''. More details can be found [https://devforum.roblox.com/t/the-future-of-cvrf/1988173 here].
</div>
== CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It is being developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 active developers and has been in active development since 2015. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest and last public build of CVRF is '''Beta 0.15.1'''.
954f8b7906a8d4c726c204394bdccfd9b103c53b
593
590
2023-10-21T00:57:11Z
Lule34567
6
Making "is" to "was"; Wikipedia editor moment.
wikitext
text/x-wiki
__NOTOC__
{| style="width: 100%;"
|-
| style="border-top: 4px solid #6F6F6F; background-color: #F6F6F6; padding: 10px 15px;" |<div style="font-size:180%;font-weight:bold;">'''
Welcome to the CVRF Wiki!'''</div><div style="padding-top:0.3em; padding-bottom:0.1em; font-size:100%;">
On this wiki, you will find information about the game's history, mechanics, locations, and more. This site has been running since January 5th, 2022, and is being hosted by [[:m:|Miraheze]].
Things are still a pretty major work-in-progress around here, and we need contributors! If you're familiar enough with CVRF and have some decent writing skills, feel free to start creating and editing articles. Simply make an account and be sure to read our [[Rules]] first.<br /></div>
|-
| style="height:10px" |
|}
<div style=" border:3px solid #faa81a; padding:8px; display:flex; align-content:center; flex-direction:column; align-items:center;">
<p style="font-size:large;"><b>ANNOUNCEMENT</b></p>
As of September 17, 2022, the Cobalt Valley Research Facility project has been put on '''indefinite hiatus'''. More details can be found [https://devforum.roblox.com/t/the-future-of-cvrf/1988173 here].
</div>
== CVRF? ==
The [https://www.roblox.com/games/257223268/Cobalt-Valley-Research-Facility '''Cobalt Valley Research Facility'''] (CVRF) is an open world, science-oriented, online roleplay game on the [https://en.wikipedia.org/wiki/Roblox Roblox] platform.
It was developed and updated by [https://www.roblox.com/groups/970502/JK-Production#!/about ''JKR Studios''] with 3 developers and was developed since 2015 up until 2022. It was previously known as the '''JKR Research Facility''' (JKRF) and the '''Hyptek Research Facility''' (HTRF). For more information, check out the [[Development history]] page.
The facility is comprised of five primary levels split into five sectors, and is notable for its compact (and admittedly maze-like) design inspired primarily by the ''[https://en.wikipedia.org/wiki/Fallout_(series) Fallout series]'' and ''[https://en.wikipedia.org/wiki/Black_Mesa_(video_game) Black Mesa]''. For a listing of notable in-game locations, check [[Facility Locations]], or alternatively check for posts in [[:Category:Locations|Category:Locations]].
''"Deep beneath the Alaskan mountain ranges, the Cobalt Valley Research Facility is home to research and development of various sectors. Accommodations are plenty, as science is a never-ending job."''<gallery mode="packed-hover">
File:20210702 154606657.png|Sector E Transit Station
File:20210702 155143411.png|Sector D Cafeteria
File:20210702 155324545.png|Level 4 Maintenance Hallway
File:20210702 155053802.png|Sector D Control Room
</gallery><small>(Screenshots by ruvir)</small>
=== Version Info ===
The latest and last public build of CVRF is '''Beta 0.15.1'''.
3819b9ea16218ff5c46064e527e4eaff27d62b21
User:KcinnaJlol
2
221
564
2022-03-14T09:29:40Z
KcinnaJlol
10
Create my user page
wikitext
text/x-wiki
Hi, I'm kcinnaJlol. You can also call me KcinnaJlol on this wiki. A link to my profile is preferred when referring to me.<br>
My gender is male (he, him).<br>
I mostly play core games (and of course CVRF), I also play [https://www.roblox.com/games/5315066937/surf Surf]<br>
I also speak Dutch (don't use it on this wiki).<br>
== How to contact ==
* Roblox: [https://www.roblox.com/users/278565150/profile kcinnaJlol]
54aa0fd53d627dc5210f33d3acb3af5ff729ebf5
573
564
2022-03-15T15:58:46Z
KcinnaJlol
10
Add contact info for Discord
wikitext
text/x-wiki
Hi, I'm kcinnaJlol. You can also call me KcinnaJlol on this wiki. A link to my profile is preferred when referring to me.<br>
My gender is male (he, him).<br>
I mostly play core games (and of course CVRF), I also play [https://www.roblox.com/games/5315066937/surf Surf]<br>
I also speak Dutch (don't use it on this wiki).<br>
== How to contact ==
* Roblox: [https://www.roblox.com/users/278565150/profile kcinnaJlol]
* Discord: RedstoneParkour#3737
0b31490d395b6b85818e57e623d6cc8d5d52723a
Sector C
0
222
565
2022-03-14T09:48:29Z
KcinnaJlol
10
Create Sector C as a redirect to [[Facility Locations#Sector C - General Research and Development Sector|Facility Locations#Sector C]]
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector C - General Research and Development Sector]]
This redirect exists so that people don't have to type the very long link to where the info about Sector C is.<br>
If you want to use this page, you may remove all of the text here (including the redirect)
da38a6acf58b65b2861260b7885a59bc581b02c9
572
565
2022-03-14T16:42:37Z
KcinnaJlol
10
Remove extra text (not needed apparently)
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector C - General Research and Development Sector]]
382f4cb54f91775961adbf14288d1cdd1dec850b
Sector D
0
223
566
2022-03-14T10:17:19Z
KcinnaJlol
10
Create Sector D as a redirect to [[Facility Locations#Sector D - Administration and Recreation Sector|Facility Locations#Sector D]]
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector D - Administration and Recreation Sector]]
This redirect exists so that people don't have to type the very long link to where the info about Sector D is.<br>
If you want to use this page, you may remove all of the text here (including the redirect)
dc97306e7270c1e27e5be47bd70d04e23d9f5967
571
566
2022-03-14T16:41:50Z
KcinnaJlol
10
Remove extra text
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector D - Administration and Recreation Sector]]
1f146463a46e53a76028bedc8561f5547543843a
Panic Rush
0
103
567
254
2022-03-14T11:20:19Z
KcinnaJlol
10
Change links to point to existing pages or to non-existing pages with sentence case
wikitext
text/x-wiki
{{Spoilers}}{{Page under construction}}
The '''Panic Rush''' is an easter egg minigame in which users have a set amount of time to collectively click all [[Panic switch|Panic Switches]] on the map to succeed. If players are unable to accomplish this in time, a bomb will appear on-screen and beep in a progressively rapid manner, immediately followed by confetti and spinning text stating "''you lose lol''". This easter egg is meant to subvert expectations by creating fast-paced suspense followed by a light-hearted reveal that there is no real danger.
== Activating the minigame ==
[[File:Contingency Unit Location.png|thumb|Location of the ventilation shaft containing the Contingency Unit]]
To activate the Panic Rush, you must first find the ''Contingency Unit''. This is a GUI panel found in a ventilation shaft directly connected to the first T-junction hallway into [[Sector A]] (from the stairwell). The Contingency Unit has a red text label on top reading "''AUTHORIZED CONTINGENCY UNIT''", and is comprised of five clickable buttons with an input label on top. Four of the buttons are characters that can be entered as a part of a password, and a green "''ACCEPT''" button at the bottom will submit the provided information to check if there is a match.
The password is randomly generated for each server, and will re-shuffle any time the minigame is triggered. It is four characters long and involves any random assortment of the following characters:
{| class="wikitable"
|+
|''Yogh''
|''Hook-tailed lowercase Q''
|''Z with swash tail''
|''Ukrainian hryvnia symbol''
|-
|'''Ȝ'''
|'''Ɋ'''
|'''ɀ'''
|'''₴'''
|}
<small>* These characters were chosen at random and have no intended meaning or significance when combined.</small>
[[File:Contingency Unit.png|thumb|286x286px|Appearance of the Contingency Unit in the ventilation shaft]]
The password ''can'' be brute-forced but is not the most efficient means of activating the Panic Rush. With four characters and a four character long password, this leaves a total of 256 possible combinations. It is faster to locate the hints placed around the map, each of which display one character of the password needed to activate the minigame.
== Password hints ==
There are a total of four locations around the map which will offer a hint towards constructing the password needed to trigger the Panic Rush. Each location gives one character of the password in the position it should be placed in. For example, if ''ɀ'' was character 2 of the password, it would be displayed as:
-''ɀ'''''--'''
The current locations these hints can be found at are:
* On the wall of the [[Cargo bay|Cargo Bay]], in the southwestern corner
* In the [[Turbine hall|Turbine Hall]], adjacent to a ladder leading to an upper catwalk
* On the wall of the tram tunnel, directly to the left of the [[Tram system#Sector A Sublevel (Station 1)|Sector A Tram Station]]
* On a pillar in the upper balcony section of the [[Cafeteria|Sector D Cafeteria]]
== Gameplay ==
[[File:PanicRushHUD.png|thumb|The HUD that is shown during Panic Rush]]
When activated, a message in chat states that the CVRF self destruct mechanism has been triggered and to cancel it, you would need to press all of the [[Panic switch|Panic Stations]] within 138 seconds once the sequence begins. After waiting a few seconds, all of the stations are marked with orange octagons to guide players in the right direction. The time and number of panic stations pressed are displayed in a ''[https://en.wikipedia.org/wiki/Payday_2 Payday 2]''-like HUD on the top right corner of the screen. When a panic station is pressed, the orange octagon highlighting its location will turn green and fade away. When the timer hits zero, and if not all panic stations have been pressed, a scene is shown to all players in an area of [[Sublevel 5]] labelled "''Contingency Room Alpha''". A red border grows on-screen alongside the beep of a bomb in the center of the room, slowly increasing in pace. A few seconds later, the border will disappear and the beeping will stop, along with a confetti effect and spinning Comic Sans text saying "''you lost lol"''. The chat message reflects this and clarifies the scenario was simply an easter egg.
[[Category:Easter eggs]]
__FORCETOC__
01996e4954d2fe2356509eb4da1053ddf97dcf7c
Sector E
0
224
568
2022-03-14T16:39:25Z
KcinnaJlol
10
Create page as a redirect to [[Facility Locations#Sector E - Materials Research and Handling Sector|Facility Locations#Sector E]]
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector E - Materials Research and Handling Sector]]
583336306969f6b66c46454350b1997d0b77045b
Sector B
0
225
569
2022-03-14T16:39:25Z
KcinnaJlol
10
Create page as a redirect to [[Facility Locations#Sector B - Maintenance and Utilities Sector|Facility Locations#Sector B]]
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector B - Maintenance and Utilities Sector]]
46a331a2d9e2baf3102684cbd2f4d8bc680fb6ac
Sector A
0
226
570
2022-03-14T16:39:30Z
KcinnaJlol
10
Create page as a redirect to [[Facility Locations#Sector A - Geothermal Sublevel|Facility Locations#Sector A]]
wikitext
text/x-wiki
#REDIRECT [[Facility Locations#Sector A - Geothermal Sublevel]]
c2d632c9c73b655cde52488eb4056b17bc189466
Z-Pinch Lab
0
227
574
2022-03-15T16:46:19Z
KcinnaJlol
10
Create the page for the Z-Pinch lab
wikitext
text/x-wiki
{{Template: Work in progress}}
The Z-Pinch lab is a lab where you can discharge a high amount of power from 3 Marx generators through very thin wires into an object, causing the energy to react with the object. The control room consists of a door with a lock to enter the Z Machine, 2 screens for information, 2 toggle switches and 2 buttons.
== Usage ==
To use the Z-Pinch lab, flip <code>CHARGE MARX</code> to on and watch the <code>MARX CHARGE STATUS</code> screen. When Bank B (the only one that seems to count) hits your desired charge level, press <code>DISCHARGE</code>. (You may first turn <code>CHARGE MARX</code> off to verify that the charge level is correct)<br>
Depending on the charge level, one of 3 things can happen:
* Misfire (undercharge): Press <code>EDL TRIGGER</code> to empty the Marx generators. There is a small chance that things go wrong and the lab will be rendered inoperable until the server is restarted.
* Normal fire: You gain 1 reputation for doing an experiment correctly, and the status screen notifies you that no data was gathered because the experiment chamber was empty. (This will be added later)
* Overload: The Z Machine overloads and the power for the entirety of Sector C East Level 4 goes out. You lose 4 reputation for doing this. To repair the power, go outside and go directly left until you reach the breaker panel inside the maintenance hallway. Open it (if not already open) and flip <code>PCT-L/RESET</code>. The power will come back on.
855274a47ea3cea3e55abc481450babc0e340a5c
575
574
2022-03-15T17:10:53Z
KcinnaJlol
10
Add page to the labs category
wikitext
text/x-wiki
{{Template: Work in progress}}
The Z-Pinch lab is a lab where you can discharge a high amount of power from 3 Marx generators through very thin wires into an object, causing the energy to react with the object. The control room consists of a door with a lock to enter the Z Machine, 2 screens for information, 2 toggle switches and 2 buttons.
== Usage ==
To use the Z-Pinch lab, flip <code>CHARGE MARX</code> to on and watch the <code>MARX CHARGE STATUS</code> screen. When Bank B (the only one that seems to count) hits your desired charge level, press <code>DISCHARGE</code>. (You may first turn <code>CHARGE MARX</code> off to verify that the charge level is correct)<br>
Depending on the charge level, one of 3 things can happen:
* Misfire (undercharge): Press <code>EDL TRIGGER</code> to empty the Marx generators. There is a small chance that things go wrong and the lab will be rendered inoperable until the server is restarted.
* Normal fire: You gain 1 reputation for doing an experiment correctly, and the status screen notifies you that no data was gathered because the experiment chamber was empty. (This will be added later)
* Overload: The Z Machine overloads and the power for the entirety of Sector C East Level 4 goes out. You lose 4 reputation for doing this. To repair the power, go outside and go directly left until you reach the breaker panel inside the maintenance hallway. Open it (if not already open) and flip <code>PCT-L/RESET</code>. The power will come back on.
[[Category: Labs]]
e93e66b5ac139d85e4ef7753e96e9f7e8c581416
Reception lobby
0
15
576
424
2022-03-18T18:11:32Z
KcinnaJlol
10
Change text for beta 0.15 to use the past tense, because beta 0.15 has already been released
wikitext
text/x-wiki
{{Template:Page_under_construction}}
[[File:Reception lobby 15.png|frameless|right|The reception area in the upcoming Beta 0.15 update.]]
The '''Reception Lobby''' is a location on [[Level 5]] in [[Sector D]]. It acts as a primary spawn location for those in the [[Visitor (role)|Visitor]] role, and is considered a central part of the map in conjunction with the [[Atrium]].
== History ==
[[File:Reception lobby really old.png|thumb|left|The reception lobby in early Beta 0.7.]]
[[File:Reception lobby 11.png|thumb|left|The reception area in a dev build for Beta 0.11.]]
=== Beta 0.7 ===
In JKRF Beta 0.7, part of the office-themed administration area on Level 4 was carved out into a reception lobby with a few rows of waiting benches. It was initially intended as a joke where people can wait for the long-delayed release and opening of the Pinewood Oil Platform, another JKR game in development at the time.
Offices for high-ranking JKR administration members were originally located adjacent to the Reception Lobby, which were later replaced by a conference room. A ceiling turret was also formerly located in the reception lobby, which was removed in a later update.
=== Beta 0.9 ===
The redesign of the [[Atrium]] in Beta 0.9 added an upper level to the Atrium at the same level as the Reception Lobby, providing access between the reception area and the Atrium. New benches were also added around this time.
=== Beta 0.12 ===
During the Foundation Update, a second level was added to the lab hallways, which changed the Atrium upper level to Level 5. As a result, the floor level that the Reception Lobby is located at was also changed to Level 5. In this update, the administration area's hallway colors were made more brown, with the Reception Lobby alongside it.
=== ''Beta 0.15'' ===
Additional plants and some trash bins were added in the Beta 0.15 update.
[[Category:Locations]]
893f66c34e592e083f25ba62a1ea0d11805474d1
File:Fish Market Explanation.png
6
228
577
2022-05-17T23:28:46Z
Lule34567
6
wikitext
text/x-wiki
Read the title.
455522f7a0acaf07291c7bd0c24da05a1aeb67c8
Development history
0
106
578
532
2022-05-17T23:32:40Z
Lule34567
6
Created "Extra Details/Trivia" section, Created "Fish Market Explanation" Subsection.
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - present) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
''To be continued...''
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
4d2bee470a530901b30f14d2097eaca210bb0d7b
585
578
2022-10-07T17:59:18Z
Lule34567
6
/* Detailed history */
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - September 2022) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
df7c34527f0dcb7c4b232c120ec4c6d0126fc395
586
585
2022-10-07T18:13:30Z
Lule34567
6
/* The Pandemical Revival (May 2020 - September 2022) */
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - September 2022) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
=== The Discontinuation Of CVRF (September 2022 - Present) ===
On the day of September 17th, 2022, CVRF was discontinued under the reason of Sink and Chrome's slow separation over the past couple of months. Not much reaction was put to it, hell, it was even made a joke out of by faking an auction for the game itself. Most people were more curious about the future of JKR Studios. Would Louie come back, or would he stay dormant as a static user? On October 6th, at 2:06 PM EST, It was announced that the game would become open source and uncopylocked for all in order to keep the game "alive" in some sort. One last party would be hosted October 9th, at 2:30 PM EST, and will conclude the final developments of CVRF before its inevitable official open source release.
However, people still question what will happen to JKR studios when its almost 7 year project comes to a conclusion. Of course, the JKR studio group will still be up and the original game will be available for all to explore and play around with, but what will happen to Sink's personal projects? Will they become open source as well? Mankind may never know.
For possibly the last time: ''To Be Continued...''
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
e55462807c25aa29c8bfc525a7d311676fffe57d
589
586
2022-10-09T20:12:00Z
Lule34567
6
Added Tournament Section
wikitext
text/x-wiki
The project has undergone many changes over the years since its inception in 2015 as the JKR Research Facility. From layout redesigns to gameplay direction changes, the project has undergone many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
== Detailed history ==
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF) was opened to the public by Diddleshot, chairman of Pinewood Builders. While it was a large, vast facility, it was very barren and lacked a proper field of science meant to be "researched", as it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the Pinewood Intelligence Agency were dismissed, prompting a series of chaos in Pinewood known as the events of 4/6. This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by KelvinBlues1 (founder and Vice CEO) RobloxGuy6403 (co-founder and CEO), and Nood563 (Development Team).
As Kelvin decided to divert his attention towards making Isla de Eras, an island roleplay game, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
Following the previous events, RG began conceptualizing the development of his own research facility.
One thing that he noted in mind was that most research facilities that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Given that Roblox would never allow such mature things on their platform, it made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make, and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - September 2022) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
=== The Discontinuation Of CVRF (September 2022 - Present) ===
On the day of September 17th, 2022, CVRF was discontinued under the reason of Sink and Chrome's slow separation over the past couple of months. Not much reaction was put to it, hell, it was even made a joke out of by faking an auction for the game itself. Most people were more curious about the future of JKR Studios. Would Louie come back, or would he stay dormant as a static user? On October 6th, at 2:06 PM EST, It was announced that the game would become open source and uncopylocked for all in order to keep the game "alive" in some sort. One last party would be hosted October 9th, at 2:30 PM EST, and will conclude the final developments of CVRF before its inevitable official open source release.
However, people still question what will happen to JKR studios when its almost 7 year project comes to a conclusion. Of course, the JKR studio group will still be up and the original game will be available for all to explore and play around with, but what will happen to Sink's personal projects? Will they become open source as well? Mankind may never know.
For possibly the last time: ''To Be Continued...''
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
=== CVRF's Final Party and Crowbar Tournament ===
With CVRF's development coming to a close, a final party was initiated at 2:30 PM EST on October 9th. Everyone was cheerful and happy during the party, some even danced ontop of server admin ''NSDoppler''<nowiki/>'s cartoonishly small head. However, most people were preparing to fight for the last competitive event taken place at CVRF, The Crowbar Fighting Tournament.
The Crowbar Fighting Tournament consisted of the atrium being used as a fighting zone. Spectators or waiting players could view from the second floor balcony onto the bottom of the Atrium, with the help of F3X-placed glass and the custom made prefab system. Those who were fighting were prepped with 4 things: 200 Health Points, A crowbar, A Medkit (which was designed to give 25 HP to the player after going below the threshold of 80 HP) and their gladiator skills. Everyone fought with great effort, but only one shall stand. At approximately 3:32 PM EST, Player and Wiki Editor ''lule34567 (referred to in the tournament as "Sir Parzival Livingston of Acerak's Glorious Kingdom")'' won CVRF's Crowbar Fighting Tournament and received 2,000 Robux as a prize. While lule wanted to donate this prize to another user, they unfortunately could not receive it due to the user rejecting the gift. On the other hand, ''NSDoppler'' received a prize of 1,000 Robux. With the Semi-Final, Final and Winner players, they would all receive a role named "''Crowbar Champion''". Attached is the bracket for the tournament and the finalized announcement made in the discord.
[[File:Tour Bracket Announcement.png|thumb|Announcement made for the Crowbar Fighting Tournament in the official JKR Discord Server]]
[[File:Tour bracket.png|thumb|Bracket used for the Sword Fighting Tournament taken place on October 9th, 2022. The numbers next to the players refer to the points given to the player and/or who was the winner of the current round.]]
8c8e5e7677f92868684e345f0f8a5d584f47aaaa
594
589
2023-10-22T19:39:53Z
ChromeEight
7
Got bored, felt like copyediting the first few sections lmao
wikitext
text/x-wiki
Since its inception as the JKR Research Facility (JKRF) in 2015, the Cobalt Valley Research Facility (CVRF) project has undergone many changes over the years. From layout redesigns to gameplay direction changes, there have been many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
At present, the project is on indefinite hiatus as of September 2022.
== Detailed history ==
The detailed history section was primarily written from memory by ChromeEight (formerly RobloxGuy6403), who served as head developer of the CVRF project from 2015 up to its indefinite hiatus in 2022.
=== The Lost Potential (Late 2014 - April 2015) ===
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF), a research facility roleplay game, was opened to the public by [https://pinewood.fandom.com/wiki/Tokaisho Diddleshot], chairman of the sci-fi building group [https://pinewood.fandom.com/wiki/Pinewood_Builders Pinewood Builders]. The facility was considered to be large and futuristic but very barren, while also notably lacking a proper field of science meant to be "researched". Of note, it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the [https://pinewood.fandom.com/wiki/Pinewood_Intelligence_Agency Pinewood Intelligence Agency], were dismissed, prompting a series of chaos in Pinewood known as the events of "4/6" or "April 6th". This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by JKR founder and then-Vice CEO KelvinBlues1, JKR co-founder and CEO RobloxGuy6403, and JKR Development Team member Nood563.
Amidst the internal turmoil within Pinewood Builders, Kelvin temporarily diverted his attention towards making Isla de Eras, an island town roleplay game based in the Pacific Ocean. During this time, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
From April to May 2015, RG began developing the concept of what would be called the JKR Research Facility.
One thing that he noted in mind was that most research facility roleplay games that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Of course, the level of mature content from the Fallout series would never stick on the Roblox platform, which made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - September 2022) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
=== The Discontinuation Of CVRF (September 2022 - Present) ===
On the day of September 17th, 2022, CVRF was discontinued under the reason of Sink and Chrome's slow separation over the past couple of months. Not much reaction was put to it, hell, it was even made a joke out of by faking an auction for the game itself. Most people were more curious about the future of JKR Studios. Would Louie come back, or would he stay dormant as a static user? On October 6th, at 2:06 PM EST, It was announced that the game would become open source and uncopylocked for all in order to keep the game "alive" in some sort. One last party would be hosted October 9th, at 2:30 PM EST, and will conclude the final developments of CVRF before its inevitable official open source release.
However, people still question what will happen to JKR studios when its almost seven year project comes to a conclusion. Of course, the JKR studio group will still be up and the original game will be available for all to explore and play around with, but what will happen to Sink's personal projects? Will they become open source as well? Mankind may never know.
For possibly the last time: ''To Be Continued...''
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
=== CVRF's Final Party and Crowbar Tournament ===
With CVRF's development coming to a close, a final party was initiated at 2:30 PM EST on October 9th. Everyone was cheerful and happy during the party, some even danced ontop of server admin ''NSDoppler''<nowiki/>'s cartoonishly small head. However, most people were preparing to fight for the last competitive event taken place at CVRF, The Crowbar Fighting Tournament.
The Crowbar Fighting Tournament consisted of the atrium being used as a fighting zone. Spectators or waiting players could view from the second floor balcony onto the bottom of the Atrium, with the help of F3X-placed glass and the custom made prefab system. Those who were fighting were prepped with 4 things: 200 Health Points, A crowbar, A Medkit (which was designed to give 25 HP to the player after going below the threshold of 80 HP) and their gladiator skills. Everyone fought with great effort, but only one shall stand. At approximately 3:32 PM EST, Player and Wiki Editor ''lule34567 (referred to in the tournament as "Sir Parzival Livingston of Acerak's Glorious Kingdom")'' won CVRF's Crowbar Fighting Tournament and received 2,000 Robux as a prize. While lule wanted to donate this prize to another user, they unfortunately could not receive it due to the user rejecting the gift. On the other hand, ''NSDoppler'' received a prize of 1,000 Robux. With the Semi-Final, Final and Winner players, they would all receive a role named "''Crowbar Champion''". Attached is the bracket for the tournament and the finalized announcement made in the discord.
[[File:Tour Bracket Announcement.png|thumb|Announcement made for the Crowbar Fighting Tournament in the official JKR Discord Server]]
[[File:Tour bracket.png|thumb|Bracket used for the Sword Fighting Tournament taken place on October 9th, 2022. The numbers next to the players refer to the points given to the player and/or who was the winner of the current round.]]
334ffc434b15cf8549bca6f9393bf7783defb53f
596
594
2023-10-22T19:44:37Z
ChromeEight
7
/* The Lost Potential (Late 2014 - April 2015) */ lol added a screenshot from 2017
wikitext
text/x-wiki
Since its inception as the JKR Research Facility (JKRF) in 2015, the Cobalt Valley Research Facility (CVRF) project has undergone many changes over the years. From layout redesigns to gameplay direction changes, there have been many changes both gameplay and direction-wise, and its development team would gradually expand over the years.
At present, the project is on indefinite hiatus as of September 2022.
== Detailed history ==
The detailed history section was primarily written from memory by ChromeEight (formerly RobloxGuy6403), who served as head developer of the CVRF project from 2015 up to its indefinite hiatus in 2022.
=== The Lost Potential (Late 2014 - April 2015) ===
[[File:WhyWeHaveJKRF.png|thumb]]
In late 2014, the [https://pinewood.fandom.com/wiki/Pinewood_Research_Facility Pinewood Research Facility] (PBRF), a research facility roleplay game, was opened to the public by [https://pinewood.fandom.com/wiki/Tokaisho Diddleshot], chairman of the sci-fi building group [https://pinewood.fandom.com/wiki/Pinewood_Builders Pinewood Builders]. The facility was considered to be large and futuristic but very barren, while also notably lacking a proper field of science meant to be "researched". Of note, it only had a glitchy centrifuge, a suicidal train testing lab, and a trampoline.
The facility would not receive any notable updates to its lack of laboratories, and all the more it did not when on April 6th, 2015, several administrative members of their internal affairs division, the [https://pinewood.fandom.com/wiki/Pinewood_Intelligence_Agency Pinewood Intelligence Agency], were dismissed, prompting a series of chaos in Pinewood known as the events of "4/6" or "April 6th". This also resulted in a hiatus in the development of the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Oil_Platform Pinewood Oil Platform] (PBOP), a facility roleplay game being built for Pinewood by JKR Productions at that time by JKR founder and then-Vice CEO KelvinBlues1, JKR co-founder and CEO RobloxGuy6403, and JKR Development Team member Nood563.
Amidst the internal turmoil within Pinewood Builders, Kelvin temporarily diverted his attention towards making Isla de Eras, an island town roleplay game based in the Pacific Ocean. During this time, RG revisited the lost potential of the PBRF as a game that could have been a fully functional research facility roleplay game.
=== The Concept (April-May 2015) ===
From April to May 2015, RG began developing the concept of what would be called the JKR Research Facility.
One thing that he noted in mind was that most research facility roleplay games that were already made on Roblox were mere clones of the two most popular ones at the time: the [https://pinewood.fandom.com/wiki/Pinewood_Builders_Computer_Core Pinewood Computer Core] (PBCC) by Diddleshot, and [https://roblox.fandom.com/wiki/Community:Madattak/Innovation_Labs Innovation Research Labs] (IRL) by madattak. Almost every clone had influences or even complete imitations of references to games in the [https://half-life.fandom.com/wiki/Main_Page Half-Life series and the Portal series], just as the two games had.
To make the game stand out, the research facility was designed to be similar to a [https://fallout.fandom.com/wiki/Vault Vault shelter] in the [https://fallout.fandom.com/ Fallout series], as not many well-done Vault shelters have been made on Roblox at that time, more so one that fell into the sci-fi research facility category. Furthermore, the game lore of the Fallout series conceptualized the Vaults as [https://fallout.fandom.com/wiki/Societal_Preservation_Program fallout shelters with social experiments gone wrong], often with high disregard to human ethics and morality.
Of course, the level of mature content from the Fallout series would never stick on the Roblox platform, which made it even more enticing for RG to create his own spin on the Fallout vault aesthetic that not only suited the Roblox style, but was easy to make and was unique in design.
=== The First Steps (May-November 2015) ===
Construction on the JKR Research Facility officially began around May 20, 2015 and was originally hosted on RG's profile (which currently holds an [https://www.roblox.com/games/233820183/JKR-Research-Facility-Early-Alpha-PUBLIC-DOMAIN open-source, preserved copy of the JKRF in Beta 0.7]). A set of hallways were placed down in preparation for the addition of labs. The first laboratory was the [[Food Labs]], which was suggested by user Shredder914. The room housed a machine that would synthetically produce bananas onto a conveyor belt, only to incinerate them after.
The game was moved to the JKR Productions group as a group game on June 9th, 2015, and a group shout was later announced on June 26th, asking for suggestions on what research laboratories to begin with.
Further additions included a [[Headcrab Lab]], which garnered a lot of popularity and record-breaking casualties at the JKRF with its initial visitors. It was further contemplated with a Weapon Testing Lab but was removed after some time due to glitches with the weapons. The reactor level was opened on June 28th, housing a generator resembling the [https://fallout.fandom.com/wiki/File:Fo3_Vault_Reactor_Level.png fusion reactors from the vaults in the Fallout series]. More would follow over the next few months, with the opening of the [[Hydroponics_Farm|Hydroponics Lab]] that grows plants in abiotic conditions, and an [[Annoying Noob Simulator]] with a blabbering, foul-mouthed noob.
The level above the laboratory level was eventually opened, leading to a high ceiling [[Atrium]], which connected to the [[Reception Lobby (location)|reception waiting area]], the [[Control Room]], and the [[Security area|Security Office]]. A [[cargo bay]] was added to the laboratory level sometime in October 2015, which houses several containers and a soon-to-be-added ramp to the surface. At this point, it was evident that the JKRF was laid out in a rather confusing manner, as the main laboratory hallway was a loop that had research labs in a random order, making it confusing for visitors.
=== Team Building (November 2015 - February 2017) ===
On November 15, 2015, it was announced that the JKRF would be almost completely renovated, with a new Atrium, a new hallway system dividing the facility into two sections; the [[Sector C West|Blue Hallway]] and the [[Sector C East|Orange Hallway]], and the alphabetical order categorization of the research laboratories. This however removed several rooms that served little purpose, such as the Security Office and the Annoying Noob Simulator, among others.
The update was released on December 25th, 2015, and JKRF development was temporarily on pause as attention was diverted to resolving bug fixes in the much-awaited and recently opened Pinewood Oil Platform, which opened on December 23, 2015.
In February 2016, oil platform development slowed down while JKRF development resumed, in which steam turbines and surface condensers were added to pave the way for the future reactor core. It was in preparation for the construction of the JKRF's Gas-Cooled Fast Reactor, which would not be informed to the public until a few months later. While JKR never had plans for a security division, one was created to avoid the scenario of a random person making one and demanding a high rank or to oversee the division as a result. Additionally, the security room was re-added to the JKRF in March 2016.
Months later, the JKRF began to form a small fanbase. One interested member named luciandean2004 (now The_Sink) found JKR and took interest after playing the JKRF a few times and getting to know the place. During the early days of the JKR Discord Server, he joined sometime in late June and approached RG with some examples of models and minor scripting knowledge that proved beneficial for the project. Sink was later on accepted as the first member of the official JKRF Dev Team.
Only days after, Sink informed his friend LouieK22 about the group and he too slowly climbed the ranks with his community support, scripting knowledge, and vouch from Sink as the second member of the JKRF Dev Team. Soon after, all three begin the final plans for the new Cargo Bay, the Surface Tunnel, and began to conceptualize the Reactor Core Meltdown in August.
For a long time, everyone was working actively on the JKRF. Development was continuous, multiple updates were released, some changes were made (such as the JKRF being released in versions instead of being updated live). To build up hype for the transition from Beta to Release, Update 0.9 was released as The Final Beta, bringing a ton of long-needed (and insanely delayed) changes to the game. But then, after a while, the development grew slow. In February of 2017, it was announced that the JKRF was officially an inactive project as everyone has lost focus and motivation.
=== Back and Forth (February 2017 - April 2018) ===
In an effort to explore new ventures and move from low-replayability sci-fi roleplay games, the JKRF development team explored the concept of a minigame lobby game under the code name Project Safehouse, where players must survive rounds of crazy research experiments inspired by the ethically questionable experiment of the Fallout series. However, development complexity increased too sporadically beyond the team's capabilities at the time, and interest in the project dwindled.
After lengthy discussions with both the community and within the administration, it was finally decided in May after a long hiatus from development that in turn of the summer and out of general boredom, the JKRF will be reactivated as JKR's primary project. It was immediately started up again, and "The Purity Update (0.10)" was the first release post-inactivity, released on May 29th, 2017.
Although significant, this period of activity soon began to fall. A large period of relatively slow development starting in March of 2018 compounded with the collaboration between JKR and Hyptek for a Minecraft server eventually pushed the decision to merge JKR and Hyptek. JKR was dissolved into Hyptek on May 4th, 2018, with Sink becoming a member of the board and other developers, such as RG (now ChromeEight) and lavafactory becoming Hyptek administrative staff by request.
=== Under New Management (April 2018 - January 2019) ===
As a result of the Hyptek merger, all active JKR projects were acquired by Hyptek and development was restarted there. From that point on, the JKR Research Facility was rebranded as the '''Hyptek Research Facility''' (HTRF).
A largely active period of what was now HTRF's development occurred between mid 2018 to early 2019. However, development soon stuttered once again as a result of a loss of motivation and the brewing internal conflict within the Hyptek administration. Each of the original developers from JKR who had joined HTRF's development team began to resign one by one until none of the original developers remained. A multitude of internal issues, summarized by the incompatibility between JKR and Hyptek's development teams combined with issues caused by infightings with Hyptek management and Hyptek developers resulted in Hyptek completely losing stability in mid 2019.
Many of Hyptek's developers split off into a new group, Plasma Inc, while the JKR developers disassociated themselves from Hyptek around a similar date between June and July of 2019. HTRF was taken down at the request of JKR's lead developers in August, and at this point, JKR entered its longest stagnant period yet.
=== The Pandemical Revival (May 2020 - September 2022) ===
After a lengthy sprawl of inactivity post-Hyptek, the [https://en.wikipedia.org/wiki/COVID-19_pandemic COVID-19 pandemic] sparked renewed interest in the project, as on May 3rd, 2020, Sink and Chrome began to discuss a possible reactivation of JKR (and by extension the JKRF).
With the new expertise gained over the hiatus, it started with the idea that the game could be developed in [https://godotengine.org/ Godot] to avoid the restrictions found on Roblox's platform, but the idea was quickly dismissed as it would be a massive technical feat for the JKR development team to create new systems from scratch that would normally be provided on the Roblox platform. Internal discussions began, along with lavafactory re-joining the development team.
Finally, on May 11th, 2020, the JKRF was re-opened to the public. The JKRF entered a new phase of active development as a result of not only the team's new knowledge of game design and scripting but also with the additional free time gained from the [https://en.wikipedia.org/wiki/Impact_of_the_COVID-19_pandemic_on_education online class setup as a result of the pandemic]. A series of updates were released afterward including the development of a [[VIP server panel]], player data backend (the base for game statistics, [[achievements]], and [[currency]]), and the redesigning of many areas in the facility.
To reflect JKR moving forward as a game studio rather than as a sci-fi corporate entity, the game was rebranded as the '''Cobalt Valley Research Facility''' in preparation for the release of Update 0.13, which went live on July 25th, 2020.
Since then, updates have continued to be developed for the game with periods of inactivity, but with the constant assurance of development remaining steady from time to time.
On January 31st, 2022, after some occasional on-and-off discussion about group branding, JKR was officially renamed to "JKR Studios" to consolidate its name across platforms.
=== The Discontinuation Of CVRF (September 2022 - Present) ===
On the day of September 17th, 2022, CVRF was discontinued under the reason of Sink and Chrome's slow separation over the past couple of months. Not much reaction was put to it, hell, it was even made a joke out of by faking an auction for the game itself. Most people were more curious about the future of JKR Studios. Would Louie come back, or would he stay dormant as a static user? On October 6th, at 2:06 PM EST, It was announced that the game would become open source and uncopylocked for all in order to keep the game "alive" in some sort. One last party would be hosted October 9th, at 2:30 PM EST, and will conclude the final developments of CVRF before its inevitable official open source release.
However, people still question what will happen to JKR studios when its almost seven year project comes to a conclusion. Of course, the JKR studio group will still be up and the original game will be available for all to explore and play around with, but what will happen to Sink's personal projects? Will they become open source as well? Mankind may never know.
For possibly the last time: ''To Be Continued...''
==Extra Details/Trivia==
As other minor details during the history of JKR are found out and revealed by the development team, they will be put here.
===Why Was JKR Called "JKR Fish Market" During It's Shutdown Period?===
Many people who were around back then may have encountered that JKR was renamed to "JKR Fish Market" for a while. Many people thought this was just random and as a replacement title since JKR, at the time, was shutdown. But actually no, it has some backstory to it.
[[File:Fish Market Explanation.png|thumb|Quoted by The_Sink in the JKR Discord Server]]
As seen in the picture right, JKR was renamed to it's fish market name due to it being close to Alaska. Since Alaska is known for its fishing (especially with salmon), the fish market title was official.
=== CVRF's Final Party and Crowbar Tournament ===
With CVRF's development coming to a close, a final party was initiated at 2:30 PM EST on October 9th. Everyone was cheerful and happy during the party, some even danced ontop of server admin ''NSDoppler''<nowiki/>'s cartoonishly small head. However, most people were preparing to fight for the last competitive event taken place at CVRF, The Crowbar Fighting Tournament.
The Crowbar Fighting Tournament consisted of the atrium being used as a fighting zone. Spectators or waiting players could view from the second floor balcony onto the bottom of the Atrium, with the help of F3X-placed glass and the custom made prefab system. Those who were fighting were prepped with 4 things: 200 Health Points, A crowbar, A Medkit (which was designed to give 25 HP to the player after going below the threshold of 80 HP) and their gladiator skills. Everyone fought with great effort, but only one shall stand. At approximately 3:32 PM EST, Player and Wiki Editor ''lule34567 (referred to in the tournament as "Sir Parzival Livingston of Acerak's Glorious Kingdom")'' won CVRF's Crowbar Fighting Tournament and received 2,000 Robux as a prize. While lule wanted to donate this prize to another user, they unfortunately could not receive it due to the user rejecting the gift. On the other hand, ''NSDoppler'' received a prize of 1,000 Robux. With the Semi-Final, Final and Winner players, they would all receive a role named "''Crowbar Champion''". Attached is the bracket for the tournament and the finalized announcement made in the discord.
[[File:Tour Bracket Announcement.png|thumb|Announcement made for the Crowbar Fighting Tournament in the official JKR Discord Server]]
[[File:Tour bracket.png|thumb|Bracket used for the Sword Fighting Tournament taken place on October 9th, 2022. The numbers next to the players refer to the points given to the player and/or who was the winner of the current round.]]
c82cd38428c9c81fdea0b2634e7d5c024ec2f22b
Control room
0
229
580
2022-05-18T15:28:39Z
KcinnaJlol
10
Create very basic page for Control room.
wikitext
text/x-wiki
{{Page under construction}}
{{Work in progress}}
The <b>Control room</b> is an area located in [[Sector D]], on levels 5 and 4. It is the main center for facility monitoring.<br/>
Currently only 2 screens are functioning and useful, that being the 'Potable water status' display and the 'Lighting status' display, showing the status of the [[Distillation lab]] and the [[Facility power]] respectively.<br/>
It also contains 2 annunciator panels for the status of the facility breakers and lockdown doors.
17646e253ac62a70d4d6110247af315744bd3e4e
User:AyScorch
2
17
581
225
2022-08-03T05:42:25Z
AyScorch
5
activity? oh right, just changed my user page to reflect underscorched rebrand, too bad I cant change username.
wikitext
text/x-wiki
Hi! I'm Underscorched (formerly known as AyScorch, shortened to just Scorch), current holder of the 666 counting role in the discord server. <s>I identify as a nuclear fusion reactor</s> I am male and go by he/him.
{| class="wikitable"
|+Find Me
!Location
!Name
|-
|Roblox
|underscorch_d
|-
|Discord
|@underscorched#2022
|-
|YouTube
|underscorched
|-
|Email•
|aryschorch@gmail.com
|}
''• Rarely check. Please use Discord when possible.''
A chair is a piece of furniture with a raised surface supported by legs, commonly used to seat a single person.
a76a1f19a2b04720f3bc723483c52adc342d7122
File:Tour bracket.png
6
230
587
2022-10-09T20:07:53Z
Lule34567
6
wikitext
text/x-wiki
Tournament Bracket used for the Crowbar Fighting Tournament, taken place on October 9th, 2022.
b578c341a66f19aa22ffa938ef59f220b4afca9f
File:Tour Bracket Announcement.png
6
231
588
2022-10-09T20:10:39Z
Lule34567
6
wikitext
text/x-wiki
Announcement made for the Crowbar Fighting Tournament in the official JKR Discord Server.
4a448216b54b92cbbc52585e79cb6f126a95c43f
User:Lule34567
2
19
591
214
2022-12-27T23:51:47Z
Lule34567
6
fixed age
wikitext
text/x-wiki
Lule34567, also named Parzival, is a 2016 Roblox user who has played JKRF since before the removal of trains. He was also nicknamed "The Mechanic" back then as he used to fix the trains becoming stuck using only a crowbar. Surprisingly, this worked but took some time in order to fix. Later, He was reunited with JKRF in 2020. A couple months after that, he was given a role during a limited time event for becoming a Forbidden Reactor Supporter which was a miniature reactor with a triangular shape but then got stripped of it after being banned for being underaged. He now resides in the server as a sort of "veteran" of JKRF and holds that role gladly. His current age is 14.
If needed, you may contact me at robertson3736@gmail.com.
Thank you.
f23f8b677c6a4515553573e4b14170336862ca03
File:WhyWeHaveJKRF.png
6
233
595
2023-10-22T19:43:46Z
ChromeEight
7
wikitext
text/x-wiki
A screenshot from the #general channel of the JKR Studios Discord server of ChromeEight saying on July 10, 2017 that the slow pace of the Pinewood Research Facility (PBRF) is why the JKR Research Facility (JKRF) came to exist.
d2fec874e146c7f237298ca3294454c9b3e6cabc